I want to check if the current time is between 10 PM and [4 AM (the next day)] in SQL.
DECLARE @tt TIME
SET @tt = CONVERT(TIME, SYSDATETIMEOFFSET())
-- 2023-09-12 19:19:35.4692966 -05:00
This will get me the current time, but how can I check if it is between 10 PM today and 4 AM the next day?
To check if the current time is between 10 PM and 4 AM (the next day) in SQL Server, you can use the following SQL query: