Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SYSDATE

Status
Not open for further replies.

vehto

Technical User
Joined
Aug 19, 2003
Messages
7
Location
US
Question: simple maybe ?
I would like too query data for the past 7 days using sysdate

where To_CHAR (Collect_dt 'MM/DD/YYYY' = To_CHAR(sysdate ? 'MM/DD/YYYY')

sysdate-7 returns only data for one day

Thanks
vehto
 
Vehto,

This should meet your needs:

SELECT whatever...
FROM whatever...
where Collect_dt between trunc(sysdate)-7 and sysdate;

This gives you all data from midnight on the morning seven days ago, up to the current minute/second.

Does this do what you want?

Dave
 
Excellent That did the trick !!

Thanks for your help SantaMufasa !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top