sql_language thread: how to compare current time value with a predefined datetime value
Ok Follow this logic You are presumably only interested in Today so your select Query can exclude datesearlier than Today Thus Where Getdate() minus 1 day Now your example is restricted to only hour 20 SELECT DATEPART(hh,adate) as interestedhour FROM TblSys WHERE DATEPART(hh,adate) = '20' and adate > GetDate()-1 This works Roland
|





