Hi pandeygolu4200,
Please refer below query.
SQL
CREATE TABLE #temp1
(
EventlocationId VARCHAR(50)
,[EventId] VARCHAR(50)
,[locationName] VARCHAR(50)
,[locationAddress]VARCHAR(50)
,[locationCity] VARCHAR(50)
,[RoomNo] VARCHAR(50)
,[EventDate] VARCHAR(50)
,[ClinicStarttime]VARCHAR(50)
,[ClinicEndtime] VARCHAR(50)
,[locationContactPerson] VARCHAR(50)
,[locationContactEmail] VARCHAR(50)
,[SpecialInstructions] VARCHAR(50)
,[CreatedBy] VARCHAR(50)
,[CreatedOn] VARCHAR(50)
,[UpdatedBy] VARCHAR(50)
,[UpdatedOn] VARCHAR(50)
,[locationId] VARCHAR(50)
)
INSERT INTO #temp1 VALUES('3622EE68-1E84-4B5A-85A8-8A02BECC532E','6FCBA375-562E-418E-8F03-705B3CEDB5C9','Firstlacation','Dadar','Mumbai','23 217','2023-01-20 08:19:19.340','09:00 AM','09:00 PM','firstconatperson','firstcontactemail@yopmail.com','NA','NULL','2023-01-10 13:31:02.020 ','NULL','NULL','2A011DF6-6627-443E-A34E-C958AE0A73CE')
INSERT INTO #temp1 VALUES('A69722F0-4F53-4E36-90F4-E2B5DF3B6E59','6FCBA375-562E-418E-8F03-705B3CEDB5C9','Secondlocation','DAndheri','Mumbai','23 219','2023-01-15 08:19:19.340','08:00 AM','08:00 PM','secondconatct','secondconta@yopmail.com','NA','NULL','2023-01-10 13:31:02.020',' NULL','NULL',' CD500780-91CF-4B24-9FA7-15A90B506C34')
INSERT INTO #temp1 VALUES('59C6A50A-C88D-4F2E-9BFF-D533284F67FC','13C1C037-257F-4BC4-BA1C-3CDF58F221CB','Center for spectrum healthcare service','3589 Big Ridge Road SpecsorPort','NY 14559','23 208','2023-02-17 13:37:07.893','10:00 AM','10:00 PM','brideg','bridheuser@yopmail.com','Emergency','NULL','2023-01-10 13:42:13.730','NULL','NULL','750F90B9-11CD-490D-8DA9-6FF2446A8B83')
INSERT INTO #temp1 VALUES('FE743FC5-5B91-4307-AD6D-3BA1A55B0FAE','F7F893C4-E192-44CB-A0FB-55FBFBD31A14','Center for spectrum healthcare service','3589 Big Ridge Road SpecsorPort','NY 14559','23 208','2023-02-16 12:37:07.893','10:00 AM','10:00 PM','brideg','bridheusers@yopmail.com','Emergency','NULL','2023-01-10 13:45:26.133','NULL','NULL','750F90B9-11CD-490D-8DA9-6FF2446A8B83')
INSERT INTO #temp1 VALUES('111646BC-77D4-490D-9C07-8BBA74872012','C0831C95-177E-4B68-9FBD-41922C397646','LA Steet','23, LA Street, Digama Raod','NY 400068','23 405','2023-02-17 10:02:31.530','09:00 AM','06:00 PM','Michael','michael@yopmail.com ','Emergency serices','9B31094C-1AD6-43A2-9DBD-6A67F0AFE838','2023-01-16 08:13:37.167','NULL','NULL','73D5644C-B14D-43E3-8985-3481CC0A60CE')
INSERT INTO #temp1 VALUES('D180C31A-8F2A-42EC-B0AB-89784C276530','C0831C95-177E-4B68-9FBD-41922C397646','Divine Street',' 24, Divine Street, Digama Raod','NY 400068','23 411','2023-02-17 11:02:31.530','09:00 AM','05:00 PM','John','john@yopmail.com','NA','9B31094C-1AD6-43A2-9DBD-6A67F0AFE838','2023-01-16 08:13:37.167','NULL','NULL','F3510748-56E4-44FF-BE52-1F618869D238')
SELECT EventId,EventDate FROM #temp1 WHERE EventDate BETWEEN DATEADD(HOUR, -24, GETDATE()) AND GETDATE()
DROP TABLE #TEMP1