David Brierton
David Brierton

Reputation: 7397

SQL Filtering a date grabbing column and having it grab 10 days previous of record

I am trying to figure out how to query a database and go back 10 days from a certain date column. I am using SQL Server 2012.

Where Date_Complete IS (10 days ago or newer)   

Any help with this would be greatly appreciated!

Upvotes: 2

Views: 43

Answers (1)

MusicLovingIndianGirl
MusicLovingIndianGirl

Reputation: 5947

Did you mean this

WHERE Date_Complete >= DATEADD(day,-10, yourdatecolumn)

If you want to consider the time from today then it'd be

WHERE Date_Complete >= DATEADD(day,-10, GETDATE())

Upvotes: 4

Related Questions