One month of data

Last Post 17 Jun 2009 03:29 AM by dale123. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
JASBRYDEN
New Member
New Member

--
16 Jun 2009 05:51 PM
I have a question

I have a table with a data time stamp that look like this

2009-06-15 17:33:40.000



I want a pull all the data the data for one month, but I do not want to hardcode it.

does it have a getdate function I could use to pull all data that is one month old ?
dale123
New Member
New Member

--
17 Jun 2009 03:29 AM
SQL Server does have a getdate function - GetDate()

If you are looking for data older than 1 month you can use
WHERE Column > dateadd(month , -1 , getdate())

Is this what you mean??


Acceptable Use Policy
---