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
Nitin SontakkePosted May 16, 2019, 12:25 AM
SmilePosted May 15, 2019, 2:53 AM
Sivakumar KonetiPosted May 14, 2019, 11:32 PM
Gajendra JangidPosted May 14, 2019, 11:22 PM
hello hema,
please have a look below code:
Nitin SontakkePosted May 14, 2019, 11:20 PM
SmilePosted May 14, 2019, 7:56 PM
Amit KumarPosted May 14, 2019, 1:46 PM
Nitin SontakkePosted May 14, 2019, 1:15 PM