• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

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

i want to check if getdate() is between 9:00 pm and 10:00 pm
0
AFIF JABADO
Asked:
AFIF JABADO
1 Solution
 
Peter KipropCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now