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.
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.