Results 1 to 9 of 9
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Query Age (Office XP )

    Hi

    I know I have posted this recently but I am still struggling to get a result, I have a field on a form named age with following formula which was kindly provided by lounge experts =Int(([datenow]-[dob])/365.25) which gives me the age in the field ,but as you can see from the screenshot I all get is a blank table when I try to query it.
    any suggestions please

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query Age (Office XP )

    Hard for us to say if we don't know what is in the table and what you entered in the parameter, don't you think?

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Query Age (Office XP )

    Hi Hans

    Do you need to see the, the table in design form or in data form, I am not quite sure what you mean by entered in the parameter.

    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query Age (Office XP )

    Would it be possible to post a stripped down version of the database?

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Query Age (Office XP )

    [Enter Age] in the criteria line is the parameter in question. Since it doesn't appear to be a field in your table, Hans is assuming it is a parameter. The other question is what kind of data you are storing in [datenow] and [dob]?

    I don't know why you would be storing a [datenow] anywhere, since that is illogical in the extreme. The current date can always be returned using the Date() function.
    Charlotte

  6. #6
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Query Age (Office XP )

    Hi Hans

    Please find attached
    Braddy
    If you are a fool at forty, you will always be a fool

  7. #7
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Query Age (Office XP )

    Hi Charlotte

    I sure this seems a bit mundane to you experts but I am struggling learner, the datenow is just a date field containing date() dob is a date of birth field

    I just want to get 63 by entering 10/9/1940 and minusing it from the date() and then be able to select in a query.

    Please excuse me if I don't explain myself to well

    Braddy
    If you are a fool at forty, you will always be a fool

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query Age (Office XP )

    The DateNow field is empty in all records in the table, so there is nothing to calculate. What did you expect?

    As Charlotte points out, if DateNow should always be the current date, you shouldn't have a field for it in the table. Use the Date() function instead. So remove the DateNow field from the table, as well as the Age field, and use Int((Date()-[dob])/365.25) as expression to calculate the age.

  9. #9
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Query Age (Office XP )

    Hi Hans

    Thank you for having patience with dummies like myself, I don't know where you find the patience.

    Thank you very much your instruction as usual was perfect.

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •