Results 1 to 9 of 9

Thread: criteria (2007)

  1. #1
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    criteria (2007)

    I have a criteria question. I only want a certain date returned to me, I usually use [Date #/#/2008?]. I am using a new qry, so I tried the same criteria. This time it doesn't work, I get all the dates in my table., since the table started. But I have noticed a difference in my tables, this specific table has the date plus time..example-> 5/28/2008 8:24:11 AM, So my question is how would I write in a criteria to return a specific date with this type of date field?

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

    Re: criteria (2007)

    You can do it like this:
    - Open the query in design view.
    - Create a calculated column like this, where DateField is the name of the date+time field:

    Int([DateField])

    - Clear the Show check box for this column.
    - Move the criteria from the DateField column to this calculated column.

  3. #3
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: criteria (2007)

    I am a little confused, am I adding 1 column or 2.

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

    Re: criteria (2007)

    Add the fields that you want to display to the query grid, then create one additional calculated column with the criteria I described.

  5. #5
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: criteria (2007)

    Is there another way that I can get the info for the date I want. For some reason, I can't get that calculated field to work for me. My column is tilted DATE, my criteria I usually use is [Date #/#/2008?]. Which this prompts me for the date (so I input the date I want the info for) and it returns the specific data from my table. But since this table has the time after the date,(example 5/28/2008 8:24:11 AM) this criteria wont work. I tried using wildcards, and that doesn't work either. Just as an FYI...This is a world table and gets continuosly updated throughout the day from another source, so I can't eliminate the time form the field.

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

    Re: criteria (2007)

    What is the type of the field? Is it a date/time field or is it a text field?

  7. #7
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: criteria (2007)

    In the world table, it is a Date/Time field.

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

    Re: criteria (2007)

    In that case, using Int([DATE]) should work. What exactly is the problem you're having?

  9. #9
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: criteria (2007)

    That was it. I got it working now. You are great! Thanks for the help.

Posting Permissions

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