Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Sort order (Access 2000)

    I have a field that contains dates in mm/yy format, but I need to sort the records in yy/mm order. Is there a way to do this using the existing field, or do I need to create a new, reversed date field from the existing one somehow?

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

    Re: Sort order (Access 2000)

    If the field is defined as a date field, you don't need to do anything special to sort it in chronological order.

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Sort order (Access 2000)

    No, it's defined as a text field.

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

    Re: Sort order (Access 2000)

    In that case, create a query and add a calculated column:

    YYMM: Right([YourField],2) & Left([YourField],2)

    where YourField is the name of the text field, and sort on this calculated column.

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort order (Access 2000)

    If you have dates before 01/01/2000 use in the query :
    DateSerial(Left([test],2),Right([test],2),1)
    Francois

  6. #6
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Sort order (Access 2000)

    Thanks, that works fine.

Posting Permissions

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