tsql how to check if datetime between 9:00pm to 10:pm

AFIF JABADO
AFIF JABADO used Ask the Experts™
on
i want to check if getdate() is between 9:00 pm and 10:00 pm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try the below
SELECT  GETDATE() where CONVERT(VARCHAR(8),GETDATE(),108) between '21:00:00' and '22:00:00'

Open in new window


Hope it helps

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial