|
-
Aug 10th, 1999, 10:57 PM
#1
Thread Starter
New Member
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
-
Aug 11th, 1999, 11:27 AM
#2
New Member
You can use function Year:
MyDate=Year(DateOfReg)
-
Aug 11th, 1999, 03:47 PM
#3
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|