Tagged Questions
3
votes
2answers
783 views
Is there a more concise way to convert a UTC datetime into a local date only?
I am trying to write a query that groups records based on the local date part only of a UTC datetime field.
For example, if my table contains 10/19/2012 2:00:00, then it should get grouped as ...
9
votes
3answers
332 views
Are these two queries logically equivalent?
Are these two queries logically equivalent?
DECLARE @DateTime DATETIME = GETDATE()
Query 1
SELECT *
FROM MyTable
WHERE Datediff(DAY, LogInsertTime, @DateTime) > 7
Query 2
SELECT *
FROM ...