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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Date Comparison

Status
Not open for further replies.

ASPProgramer

Programmer
Feb 4, 2004
1
IN
How do I run a query to take all records from my table that are no older than seven days. A Date field has the system date from the insert and is formatted like 9/21/2000 10:00:50 AM.

I want to display all records from the last seven days. any suggestions would be helpful.

Thanks,
 
select * from MyTable where DATEDIFF(day, MyColumn, GetDate()) <= 7 [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top