RE: how to use time functions in sql server?
ok try something like this: create table t(d datetime) insert into t values('2002-01-01 14:15:02') insert into t values('2002-01-01 15:15:02') select * from t where abs(datediff(mi,cast('1900-01-01 '+substring(convert(char(19),d,120),12,19) as datetime), cast('1900-01-01 '+substring(convert(char(19),getdate(),120),12,19) as datetime))) <=30 Gregory Larsen, DBA If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
2003-06-05