1
vote
1answer
259 views

Find Duplicate Customers

Okay... I have a table that has customers: -- Individual Table * ID (Internal Unique ID) * IndividualID (External Unique Individual Identifier) * Last Name * First Name * Birth Date * SSN * ... The ...
3
votes
2answers
3k 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
409 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 ...