Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Query (Acess 2000 SR1)

    Hi,

    If I have a form that has only one date field can I make a query where I can put in something like [FromDate] and then [ToDate] and the query will return all details between those 2 dates. I have tried various things but seem to be banging my head against a brick wall.

    Thank you

    James

  2. #2
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Query (Acess 2000 SR1)

    Hi James,

    In the criteria for the date field in the query use the Between operator as: Between [FromDate] and [ToDate]

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Query (Acess 2000 SR1)

    Thanks for responding Dottie, I have tried this before and I can't seem to get it to work, my field is called EventDate and in its query criteria I have exactly what you said Between [FromDate] and [ToDate]. My date format uses the short date input mask 00/00/00.

    When I enter the FromDate in the first box 01/11/01 I get an error box that says

    "The expression is typed incorrectly, or it is too complex to be evaluated. For example a numeric expression may contain too many complicated elements. Try simplifying the expression by assinging part of the expression to a variable".

    Can you shed any light please?

    TIA

    James

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Date Query (Acess 2000 SR1)

    Typically the error message you receive is due to mismatched data types. Check the following:
    1 - In the data you are querying, Is the Data Type of the field, EventDate, a date time field or text? If it is text, you will need to convert it to a date field.
    2 - If the EventDate field is a date field, ensure you are entering the format correctly in your [from] and [to] box of your between statement.
    Regards,

    Gary
    (It's been a while!)

  5. #5
    New Lounger
    Join Date
    Nov 2001
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Query (Acess 2000 SR1)

    Thanks Gary and Dottie for your advice, it turns out that somehow my date field was corrupted, I put a new one into the table and deleted the old one and it works fine.

    James

Posting Permissions

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