I have a SQL Server database table that I want to select rows from for the last seven days. I use the date field, but it appears that my query isn't working correctly, I may be missing records from today, the day I actually run the query. Here is my query
select * from tablea
where DATEFIELD > DATEADD(DAY, -7, GETDATE())
AND DATEFIELD < DATEADD(DAY, +1 GETDATE())
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.