Date Range Parameter - Including timestamps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kerryn
    New Member
    • Aug 2008
    • 2

    Date Range Parameter - Including timestamps

    Hi all new to this site so looking for some help.

    I am working in Access 2002, using a select query. I am trying to use a date range parameter to allow the users to end the start date and end date i.e 1/1/08 and 31/1/08, the field name is Transaction Date and some dates have timestamps and some dont.

    Parameter >=[Enter Start Date] And <=[Enter End Date]

    When entering the last date the query, if the transaction date record has a time stamp of 31/1/08 10:23 this is not being returned.

    How can I use a parameter to include these records, so that when entering the last date it still picks up records with timestamps.

    Thanks Heaps
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    In the Query Grid for the query, you need to create a calculated field to only return the Date part of the Transaction Date:

    Code:
    DateOnly:DatePart("m",[Transaction Date])& "/"& DatePart("d",[Transaction Date])& "/"& DatePart("yyyy",[Transaction Date])
    then run your parameters against this calculated field, DateOnly, instead of the actual Transaction Date field.

    Linq ;0)>

    Comment

    • Kerryn
      New Member
      • Aug 2008
      • 2

      #3
      HI Linq

      Thanks for the quick response.

      I did try this code and yes did work, however when I add the parameter information it brought out all records.

      Found another function DateValue, tried this and it worked quicker.

      Thanks for you help
      Kerryn

      Comment

      Working...