Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Get time from column

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-10 : 11:42:49
Trying to get the records where the date = today and the time is only
within 15 mintues
So if the time was 10:20 i only get records 2 and 3
COLUMN STAT_DATE
1.2008-06-10T10:30:00.537
2.2008-06-10T10:15:00.530
3.2008-06-10T10:00:00.760

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-10 : 11:43:56
SELECT * FROM YourTable WHERE STAT_DATE > DATEADD(mi,-15,GETDATE())
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-10 : 17:55:03
Thanks i could not see if for looking..
Go to Top of Page
   

- Advertisement -