Results 1 to 4 of 4

Thread: Sort question

  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Unanswered: Sort question

    I have a simple question, really. I have a date field in my form and I want to sort by the date, rather than the month or the year. How do I create that in my underlying query?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    ... ORDER BY DatePart("d",[MyDateField]) ASC/DESC;

  3. #3
    Join Date
    Feb 2004
    Posts
    4
    Originally posted by M Owen
    ... ORDER BY DatePart("d",[MyDateField]) ASC/DESC;
    Thanks...I put that in the form property but I'm not seeing any difference. The date is in the short date format.

  4. #4
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    I have a date field in my form and I want to sort by the date...
    Perhaps try something like this in the underlying query's SQL statement:
    ORDER BY MyDateField

    Or if want to see the most recent dates first:
    ORDER BY MyDateField DESC

    Or if you want to sort by date but perhaps your form is based on a table instead of a query, then in the form's OrderBy property:
    MyDateField
    Last edited by Bullschmidt; 02-03-04 at 00:15.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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