Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Massachusetts, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Query? (XP)

    I am having trouble with criteria, I was trying to have a user prompt for a year and then it would return all records for that year. I tried like */*/[Enter Year] but it didn't work. Any help appreciated

  2. #2
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Query? (XP)

    You need to extract the Year from your stored Date entry using a "Field Expression".
    You then set up a prompt in the Criteria section of this field expression to get the user to enter the Year to filter the desired records.

    Here is an example of the field expression you need in your query:

    TheYear: DatePart("yyyy",[YourDateField])
    (change "YourDateField" to the name of the field that contains the Date data)

    Then in the Criteria section of the QBE grid of this added expression use something like this:
    [Enter 4 digit Year]

    The above will prompt the user to enter the 4 digit year that you want to set as the criteria for the query.

    HTH
    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

Posting Permissions

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