• criteria in a query (access 97-sr2)

    Author
    Topic
    #373863

    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

    Viewing 1 reply thread
    Author
    Replies
    • #602325

      Hi Mike,

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

    • #602332

      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.

    Viewing 1 reply thread
    Reply To: criteria in a query (access 97-sr2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: