Results 1 to 4 of 4
  1. #1
    copaaccess is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3

    Dates


    I am using MS access via OBDC to a DB.

    A column in a table contains dates, however they are in the format DD/MM/YYYY and DD/MM/YYYY HH:MM:SS.

    I have a query (main) that calls other queries (sub), and the Main query requires the user to input a From and To date.

    The results of the query exclude the records that have HH:MM:SS for the To date.

    How can I ensure I retrieve the missing dates?

    I have tried converting the date to text by the of the Day, Moth, Year function, and then converting it back with DateValue. ie

    td: DateValue(Day([add_date]) & "/" & Month([add_date]) & "/" & Year([add_date]))

    If I place the date range in the criteria field ie "between #01/01/2012# and #05/01/2012#", the query works fine and the results back are as expected. If I change the criteria to "between [From] and [To]" and then run the query and I put in 01/01/2012 for From and 05/01/2012 for To, I get all records with a value of DD equal to 01, 02, 03, 04, 05, and MM and YYYY every combination that is in the data ie 01,02,03,04,05,06,07,08,09,11,12 and 2012, 2011, 2010 etc

    All the queries are built in the Design section and not in VB

    I am at wits end

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What is the backend database?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    copaaccess is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    3
    DB2, On set of dates is added for a user process ie with time, and the other without time is added by a batch upload

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You say dates are formatted as DD/MM/YYYY but it is possible that they are actually stored as MM/DD/YYYY. I do work with some db4 tables and that is my experience. Where is the DD/MM/YYYY format set - in db2 or Access?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  2. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  3. Dates
    By talisman in forum Programming
    Replies: 1
    Last Post: 02-25-2011, 11:42 AM
  4. display all dates between two dates
    By KenThompson in forum Access
    Replies: 8
    Last Post: 02-23-2011, 01:11 PM
  5. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums