carsRST
asked on
Oracle - Date SQL calcs
Looking for a "between" statement that will go back 30 days from yesterday's date and end at yesterday's date.
Example if the statement ran today:
...where full_date between ('1/21/2011' and '2/20/11')
Example if the statement ran today:
...where full_date between ('1/21/2011' and '2/20/11')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sdstuber = great person
Thanks!
Thanks!
and finally, one more option...
where full_date between trunc(sysdate)-31 and trunc(sysdate)- (1/86400)
where full_date between trunc(sysdate)-31 and trunc(sysdate)- (1/86400)
where full_date >=trunc(sysdate)-31 and
full_date <= trunc(sysdate)-1 + (86399/86400)
or
where full_date >=trunc(sysdate)-31 and
full_date <= trunc(sysdate) - (1/86400)
or
where full_date >=trunc(sysdate)-31 and
full_date < trunc(sysdate) ----- note < not <=