Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    criteria in a query (access 97-sr2)

    I have a query that runs after you enter a beginning date and an ending date in different text boxes. Everything works except that the ending date is always 1 day less than the date you enter into the end date box. Here is the criteria I am using- >=[forms]![frmmspselectpercent]![text15] And <=[forms]![frmmspselectpercent]![text17]. If I enter 1 day after the date I want, it works fine, but I have different users entering dates and they won't remember what to do. I don't understand why the "<=" section of the criteria does not return the end date entered into the text box.

    Any help will be appreciated.
    Mike

  2. #2
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: criteria in a query (access 97-sr2)

    Hi Mike,

    Does the date field contain the time also? You may have to add a +1 to your ending date.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: criteria in a query (access 97-sr2)

    Your date field in table probably has a time component. Therefore, you need to modify the 2nd part of your criteria like this: ... And <[forms]![frmmspselectpercent]![text17] + 1

    Notice I used "<" and not "<=", and I added 1 day to ending date. So let's assume you asked for July 1,2002 thru July 31, 2002, your selection criteria would actually get all records with date greater than or equal to July1, and LESS THAN August 1. You have to be careful, otherwise you could get a date that was 12:00am on August 1.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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