I need to take the current date and get a range between the current date and back 1 hour or 60 minutes using SQL and an SQL Database.
Does someone have some sample code to show me please?
Printable View
I need to take the current date and get a range between the current date and back 1 hour or 60 minutes using SQL and an SQL Database.
Does someone have some sample code to show me please?
Hi Bebe Try This out
SELECT testdate FROM tbltest WHERE DATEDIFF(hour,testdate,getdate()) <= 1
Or
SELECT testdate FROM tbltest WHERE DATEDIFF(minute,testdate,getdate()) <= 60
Hope This Helps
Ian
[Edited by Ianpbaker on 05-26-2000 at 08:55 AM]