PDA

Click to See Complete Forum and Search --> : WHY CAN'T I EVER HAVE A SIMPLE PROBLEM


amacfarl
Aug 10th, 1999, 10:57 PM
Hi all it is me again. Firstly I would like to thank everyone who has helped me in the past. But I have now got a very challenging problem.

I am creating a database for Leprosy patients, in which there are two fields, Date of Registration (eg, 15/08/1998) and Year of Birth (eg, 1977). People in rural areas of India do not know thier full date of birth!!

I am trying to extract all patients who were under the age of 14 at the time of registration (Date of Registration), using SQL. I cannot just do YEARofBirth > DateOfReg - 14. It just does not work. How can I clip the DateOfReg to just have the year.

This problem has really stumped me. I am resorted to you one word - HELP!!!!!!!

Kind Regards,

Angus

Ludmila
Aug 11th, 1999, 11:27 AM
You can use function Year:
MyDate=Year(DateOfReg)

Serge
Aug 11th, 1999, 03:47 PM
You can use SQL statement like this:


Select * From Patients Where Year(DateOfReg)-YEARofBirth < 14



NOTE: I assumed that table name is called Patients.

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com