I\'m using sql server 2008. How to query out a data which is the date is today and 7 days before today ?
Try this way:
select * from tab where DateCol between DateAdd(DD,-7,GETDATE() ) and GETDATE()