Smile

Smile

  • 1.5k
  • 198
  • 36.5k

Fetch records after 23:59:59

May 14 2019 4:56 AM
Select Pkey ,ArrivingTime,DepartureTime from table1 where Arrival between (select left(CONVERT(VARCHAR(8),getdate(),108),5)) and sELECT Convert(Varchar(5),DATEADD(MINUTE, 60, (SELECT DATEADD(MINUTE, 0,CONVERT(Time,GETDATE()))))) order by Arrival 
 
Above is get the records from table on time based i.e from current time to next 60 minutes
This query works fine till 23:59:59 but unable to fetch records for next  day i.e. 00:00 ,01:00 hrs 
 
Any suggestions will be helpful 

Answers (8)