Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Before Date Query

Status
Not open for further replies.

Hinfer

Programmer
Sep 14, 2001
69
CA
I am trying to do a simple query to count records before the year 1995 and with no education ID. I am having problem with the date expression. Cna some one help?

The date format that appears in the table is yyyy-mmm-dd (2001-Jan-01)

SELECT Count(dbo_patient.patid) AS COUNT, dbo_patient.birthdate
FROM dbo_srvcevnt RIGHT JOIN (dbo_education RIGHT JOIN dbo_patient ON dbo_education.patID = dbo_patient.patid) ON dbo_srvcevnt.clntshid = dbo_patient.patid
WHERE (((dbo_education.educationID) Is Null) AND ((dbo_patient.birthdate)<1995));
 
If u r using the Count, don't you need grouping also?

What about the Year function:

Year(yourDate)<1995

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top