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

Date / Time

Status
Not open for further replies.

dhoward007

Programmer
Feb 6, 2002
45
US
I am having a problem calculating dates.

I have a field datetime and I need to delet records older than 60 days.. my query is something like this.


delete from table where statdate < dateadd(day, -60, getdate())


For some reason this doesn't work.. Can you give me some suggestions?

 
I tested your command on a test table of mine and it worked. However, I noticed that you used the field name statdate - did you mean startdate?
 
Sorry... I feel really stupid...


The query did work, I wasn't looking at the year so I though it wasn't working...


DUH!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top