Prior week from current date

Database

Prior week from current date

I have tried several methods of comparing a date (datetime) field from the dw with the current date (- 7 days) with NO luck.

ORDER_CREATE_DT = 2007-04-03 12:00:00.000001

WHERE ORDER_CREATE_DT >= CURRENT_TIMESTAMP - 7

I have tried CURRENT_DATE as well due to the format of the ORDER_CREATE_DT. Also I attempted to cast the ORDER_CREATE_DT with no success either.

Any suggestions would be appreciated.

thanks,
Scott
2 REPLIES
Enthusiast

Re: Prior week from current date

WHERE ORDER_CREATE_DT(DATE) >= CURRENT_DATE - 7
Teradata Employee

Re: Prior week from current date

Or if you care about the time of day
WHERE ORDER_CREATE_DT >= CURRENT_TIMESTAMP - INTERVAL '7' DAY