Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sort by date (dd/mm/yyyy) (AccessXP)

    I have a query that sorts the dates in ascending order. The date format that I am using is dd/mm/yyyy. However, the result of the query gives me an unordered list:

    04/09/2006
    07/08/2006
    08/05/2006
    09/08/2006
    12/05/2006
    12/07/2006
    13/06/2006
    25/08/2006
    26/04/2006

    Is there something I can do to fix the order?

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

    Re: Sort by date (dd/mm/yyyy) (AccessXP)

    It looks as if they are text values, not dates. Is this a text field that contains date-lookalikes, or have you used the Format function to force the result into dd/mm/yyyy format?

  3. #3
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort by date (dd/mm/yyyy) (AccessXP)

    Thanks Hans. I used the format function. Now that I have removed this it sorts correctly. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

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

    Re: Sort by date (dd/mm/yyyy) (AccessXP)

    You can use the Format property (instead of the Format function) to display the dates the way you want.
    Or if you really need the formatted text values, for example for a mail merge in Word, or for exporting purposes, you can use two columns: one with the date values, used for sorting (this column can be hidden if desired), and one with formatted text values.

Posting Permissions

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