Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sort Date Field (2003)

    In Microsoft Access I am trying to sort on a date field field however the sort is not coming out correctly. What am I doing wrong? Attached is the result of my sort A-Z on my birthday field (MM/DD).

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort Date Field (2003)

    When you sort your field, select the month only (i.e.<span style="background-color: #FFFF00; color: #000000; font-weight: bold">01</span hi>/31) and try to sort like that...

    Edit: is your field's Data Type a Date and the format mm/dd? Screenshot added.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

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

    Re: Sort Date Field (2003)

    The dates are formatted as m/d, but they may contain a year component. Access sorts on the entire contents of the field, not just on the displayed values. So if 12/19 is actually 12/19/1972 and 3/13/ is 3/13/1980, Access will sort 12/19 before 3/13.
    If you want to sort on month and day only, create a query based on the table, add the fields you need, plus two calculated columns:

    M: Month([Birthday])

    and

    D: Day([Birthday])

    Sort ascending on these columns. You can clear the Show check box for these columns.

Posting Permissions

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