I want to find records in between date 07/05/2019 to 08/05/2019 and time 5:00PM to 4:00AM respectively i.e in between 07/05/2019 5:00PM and 08/05/2019 4:00AM
I Have Used following query but it doesnot work Please help.
select * from TagInWardMaster where
(InsertedOn >= '07/05/2019' AND InsertedOn < DATEADD(DAY, 1, '08/05/2019'))
and RIGHT(CONVERT(nvarchar,insertedon,100),7) between ' 5:00PM'and ' 4:00AM'
select * from TagInWardMaster where
(InsertedOn >= '07/05/2019' AND InsertedOn < DATEADD(DAY, 1, '08/05/2019'))
and convert(nvarchar(5),InsertedOn,108)>='17:00' and convert(nvarchar(5),InsertedOn,108)<='04:00'