David Brierton David Brierton - 10 months ago 30
SQL Question

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!


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())