Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    QRY retreive date (2002)

    How can I design a Qry to retreive all requested dates in a table by entering the last two numbers in a "like" box. Dates in the table are of varied formats, ie: 8/12/2005 or 8/12/05 or Aug/12/2005 etc.
    Field name is "Date ordered"
    Thanks in advance

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

    Re: QRY retreive date (2002)

    By "last two numbers", do you mean that you want to enter "05" for records from 2005, or "99" for records from 1999? If so, enter the following in the Criteria line of the query in the column for Date Ordered:
    <pre>Like "*" & [Enter 2 digit year]
    </pre>

    If you meant something else, please explain.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QRY retreive date (2002)

    What I would like to do is enter the two digit year in the "like" box, and retreive all records in that year, even if the date in the field is 8/12/05, or 8/12/2005 How do I set up the qry to do that?

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: QRY retreive date (2002)

    Assuming (for the time being) that all dates are dd/mm/yyyy format you can use Between "31/12/04" And "12/6/05"

    if you want just a years worth you could do it for Between "1/1/04" And "12/31/05" (mm/dd/yyyy)


    This works in my test database
    Jerry

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

    Re: QRY retreive date (2002)

    The way I described. See screenshot below

  6. #6
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: QRY retreive date (2002)

    Hans,
    There must be a difference in the placement of the wild cards * & . I had them after the input request, and you show them before. Works fine
    Many thanks.

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

    Re: QRY retreive date (2002)

    <code>Like "*" & [Enter 2 digit year]</code> means: it can begin with anything (*) but it must end with the digits supplied by the user.

    <code>Like [Enter 2 digit year] & "*"</code> means: it must start with the digits supplied by the user, but it can end in anything.

Posting Permissions

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