All Forums Database
sparrott 1 post Joined 04/07
13 Apr 2007
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.000001WHERE ORDER_CREATE_DT >= CURRENT_TIMESTAMP - 7I 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

joedsilva 505 posts Joined 07/05
16 Apr 2007

WHERE ORDER_CREATE_DT(DATE) >= CURRENT_DATE - 7

Fred 1096 posts Joined 08/04
16 Apr 2007

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

You must sign in to leave a comment.