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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access sql code Help!

Status
Not open for further replies.

deanwat

Technical User
Joined
Nov 2, 2007
Messages
2
Location
US
I have a form that contains DOB I have got my sql code to figure age by DOB for a query, but now I also need to figure youth(10-18, Adult1(19-25), Adult2(26-50) and Adult3(51 & older)From DOB or my new query field Age.
Here is the code I have so far:
SELECT tblCustomer.IdNumber, tblCustomer.FirstName, tblCustomer.LastName, tblCustomer.DOB, DATE(), (YEAR(DATE())-YEAR(DOB))-(RIGHT(DATE(),5)<RIGHT(DOB,5)) AS Age
FROM tblCustomer;

Please Help someone.
 
do you want an Access query or a SQL Server query?

you posted in the SQL Server forum

perhaps you want forum701

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top