Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameter query with date (2003)

    Hello,

    I have a parameter query that is based on a date field. If I put Between 01/01/2007 and 01/31/2007 the query works. If I put Between [begindate] and [enddate] where they have to put in the date then it doesn't work.. Would anyone know what is happening?

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

    Re: Parameter query with date (2003)

    In what sense doesn't it work?
    - Do you get an error message (if so, what does it say?)
    - Does the query return no records at all?
    - Does the query return the wrong records (if so - any pattern?)
    - Something else (if so, what?)

  3. #3
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameter query with date (2003)

    no records at all.

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

    Re: Parameter query with date (2003)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameter query with date (2003)

    Here it is.
    Attached Files Attached Files

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

    Re: Parameter query with date (2003)

    1) Open the problem query in design view.
    Select Query | Parameters.
    Enter [date] in the Parameter column and select Date/Time as data type.
    Enter [date2] in the Parameter column in the second row and select Date/Time as data type.
    Click OK.
    This should make the query work.

    2) Keep in mind that the DDD field has both a date and a time component. So if you enter 03/01/2007 for 'date' and 03/10/2007 for 'date2', no records will be returned, since the first record has DDD = 03/10/2007 01:14 PM, and this is larger than 03/10/2007 (which evaluates to 12:00 AM).

  7. #7
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameter query with date (2003)

    Thanks that works.

Posting Permissions

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