Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Date in where Clause

$
0
0

I have a table which has date column. I would like to run the query which will pull the data for last 7 days.

Date format looks like that : 2015-01-05 10:58:16000

Not sure why my query not working

Select * from Table1

where date < getdate() -7


simam


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>