Results 1 to 6 of 6
  1. #1
    KrenzyRyan is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    54

    Date not Sorting Correctly (screenshot attached)

    I cannot seem to figure this one out. The date is not sorting correctly on this query, see below:



    Any thoughts?

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Your dates are not the date/time datatype. They are TEXT. So in order for the sorting to work you need to either have them as that data type or change the field in the query by using CDate or by using your own custom group in the report and use CDate.

  3. #3
    KrenzyRyan is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    54
    Excellent, thanks Bob.

  4. #4
    KrenzyRyan is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    54
    Hmm, now the time isn't sorting correctly. I want it to sort ascending, and its set as a Date/Time field.

  5. #5
    KrenzyRyan is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    54
    The query does it correctly, but the report mixes it up...

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You need to create a new field using the date and time fields concatenated:

    Code:
    Select Cdate([DateFieldNameHere]) + CDate([TimeFieldNameHere]) As MyDateTime...etc.
    And then you would use that field name (MyDateTime or whatever you called it) in the Sorting And Grouping of the report to sort on.

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

Similar Threads

  1. Sorting by date
    By kaledev in forum Queries
    Replies: 2
    Last Post: 03-16-2011, 12:32 PM
  2. Sorting date columns in query
    By madcreek in forum Queries
    Replies: 3
    Last Post: 06-02-2010, 07:45 AM
  3. Date Sorting
    By sfoot0309 in forum Queries
    Replies: 1
    Last Post: 04-25-2010, 09:59 PM
  4. Sorting by date between different groupings
    By wagspk in forum Reports
    Replies: 0
    Last Post: 03-11-2009, 11:53 PM
  5. Sorting By Date!
    By Pirate in forum Access
    Replies: 0
    Last Post: 07-19-2007, 02:42 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