Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Nov 30, 1999

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 Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date