CURRENT_DATE - 1

Database
N/A

CURRENT_DATE - 1

Any suggestions? This isn't working...I searched other forum topic on this and saw some, tried suggested tips but still did not work.

SELECT *
FROM MTGLIBP1.CHTRNSAC a
WHERE a.TRNDTE = (current_date, - 1) (format 'yyyymmdd') AND a.KEY > (SELECT MAX (KEY) FROM MTGLIBP1.DAILYTRNPF)
2 REPLIES
Junior Contributor

Re: CURRENT_DATE - 1

Just remove the comma and the format:
WHERE a.TRNDTE = current_date - 1 AND a.KEY > (SELECT MAX (KEY) FROM MTGLIBP1.DAILYTRNPF)

Dieter
Enthusiast

Re: CURRENT_DATE - 1

Another way :
using following syntax:
SELECT * FROM ISEN.ACCOUNT_DETAILS
WHERE REC_LOAD_DATE= (CURRENT_DATE- INTERVAL '1' DAY);

see below:

SELECT *
FROM MTGLIBP1.CHTRNSAC a
WHERE a.TRNDTE =(CURRENT_DATE- INTERVAL '1' DAY) AND a.KEY > (SELECT MAX (KEY) FROM MTGLIBP1.DAILYTRNPF);