devxlogo

Extracting Dates

Extracting Dates

Question:
How do I extract dates from SQL where the date type is a datetimestamp? I have the following SQL statement:

select * from Patient where PatientDOB = "03/01/58"

It works but doesn’t give me any results due to the 12:00 AM part. How do I solve this?

Answer:
You can solve it by bracketing your dates in the WHERE clause to be WHERE Patient.DOB BETWEEN (startdate) and (enddate).

devx-admin

Share the Post: