-
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
-
You can use function Year:
MyDate=Year(DateOfReg)
-
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
[email protected]
[email protected]