Hello All,
I\'ve had some confusion for quite some time with essentially flooring a DateTime SQL type using T-SQL. Essentially, I want to take a
Here's a query that will return all results within a range of days.
DECLARE @startDate DATETIME
DECLARE @endDate DATETIME
SET @startDate = DATEADD(day, -30, GETDATE())
SET @endDate = GETDATE()
SELECT *
FROM table
WHERE dateColumn >= DATEADD(day, DATEDIFF(day, 0, @startDate), 0)
AND dateColumn < DATEADD(day, 1, DATEDIFF(day, 0, @endDate))