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

time / date function? 1

Status
Not open for further replies.

yebaws

Technical User
Mar 22, 2007
42
GB
When a new entry is added to a table, the timestamp is added with CURRENT_TIMESTAMP. I want to run a query to find all entries in the table that were added, say, 330 days ago or more. I can think of a very roundabout way of doing this, and know that there must be a simple way to do this, but just can't find what it is. Any ideas?

Thanks.
 
[tt][blue]
Select *
From YourTable
Where YourTimeStampColumn < GetDate() - 330
[/blue][/tt]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top