Results 1 to 3 of 3

Thread: WHY CAN'T I EVER HAVE A SIMPLE PROBLEM

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    4

    Post

    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



  2. #2
    New Member
    Join Date
    Jan 1999
    Location
    Cleveland,Ohio,USA
    Posts
    6

    Post

    You can use function Year:
    MyDate=Year(DateOfReg)

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
  •  



Click Here to Expand Forum to Full Width