I have scenario where i need to list the data from table which have date less than 24 hours from current date time.
Below is my table
EventlocationId EventId locationName locationAddress locationCity RoomNo EventDate ClinicStarttime ClinicEndtime locationContactPerson locationContactEmail SpecialInstructions CreatedBy CreatedOn UpdatedBy UpdatedOn locationId locationContactPhone
526C4B8F-011E-425B-8EC7-A9C5543C61DD 10ABC3E1-228B-4213-AA10-DFC575B259B7 Andrew St Path 4312 EarnHardt LoiseVille,KY 40202 23 411 2023-02-20 08:02:31.530 09:00 AM 12:00 PM Michael michael@yopmail.com Emergency serices NULL 2023-02-02 10:41:45.800 NULL NULL 86CF7C8B-F6EB-4875-9C60-BA7349B4F3D1 8777777777
19CAA9F6-17E2-4F43-B9C3-C0A4559951D3 10ABC3E1-228B-4213-AA10-DFC575B259B7 Clinton Ave Path 1452 Hamilton Drive Texas City,TX 77591 23 400 2023-02-17 08:02:31.530 10:00 AM 12:00 PM John john@yopmail.com NA NULL 2023-02-02 10:41:45.800 NULL NULL 75BA82D5-D018-42E8-AE46-140025A1AF26 8777777777
83AEC875-03EA-4516-AE47-B7ECD5F738D8 6F49D459-7F3E-4777-830A-A4BE84586D67 Andrew St 4312 EarnHardt LoiseVille,KY 40202 23 411 2023-02-21 08:02:31.530 09:00 AM 12:00 PM Michael michael@yopmail.com Emergency serices NULL 2023-02-02 10:45:22.520 NULL NULL 988AFFEE-7D89-4C4E-A2DE-19316378DBE0 8777777777
A2D8F720-F88B-49B9-913E-C2579940F73B 6F49D459-7F3E-4777-830A-A4BE84586D67 Clinton Ave 1452 Hamilton Drive Texas City,TX 77591 23 400 2023-02-21 08:02:31.530 10:00 AM 12:00 PM John john@yopmail.com NA NULL 2023-02-02 10:45:22.520 NULL NULL 76FDE3BC-B98C-4BBF-B4D9-F270E58B6C16 8777777777
BE0C59EA-93B0-4C04-90C8-329E86E4A894 25239A91-55E5-4553-B6E9-57137DD39414 Andher 4312 EarnHardt LoiseVille,KY 40202 23 411 2023-02-24 08:02:31.530 09:00 AM 12:00 PM Michael michael@yopmail.com Emergency serices NULL 2023-02-02 10:48:56.870 NULL NULL 6D8AE5F9-8DE2-4489-82E2-38473C20F60F 8777777777
select EventId,EventDate from tblEventlocationmapping where EventDate>dateadd(hour, -24, '2023-02-16 13:27:21.980');
I have tried multiple ways to solved, but none are working