472,126 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 software developers and data experts.

How to "ORDER BY" in descending order?

I have the following query in a combo box:

SELECT courses.courseCode, courses.courseDescription FROM courses ORDER BY
courseDescription;

I want to change the "ORDER BY" to display in descending order so the more
recent courses appear first on the list. How do I modify this query to
accomplish that end?

Thanks!

Rich Hollenbeck
Moreno Valley, CA USA
Dec 8 '06 #1
2 53328
Use DESC in the ORDER BY clause for a descending sort.

Assuming you have a CourseDate field so you can determine "more recent":
SELECT courses.courseCode, courses.courseDescription
FROM courses
ORDER BY CourseDate DESC, courseDescription;

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Richard Hollenbeck" <ri****************@verizon.netwrote in message
news:6W9eh.782$qh.171@trnddc06...
>I have the following query in a combo box:

SELECT courses.courseCode, courses.courseDescription FROM courses ORDER
BY courseDescription;

I want to change the "ORDER BY" to display in descending order so the more
recent courses appear first on the list. How do I modify this query to
accomplish that end?

Thanks!

Rich Hollenbeck
Moreno Valley, CA USA

Dec 8 '06 #2
Use DESC in the ORDER BY clause for a descending sort.

Yes that did it. This is such a nice trick that I'm rewriting all my code,
wherever necessary, to include it.

Thank you very much!
Jan 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by ian justice | last post: by
1 post views Thread by Simon Wigzell | last post: by
3 posts views Thread by kartik | last post: by
reply views Thread by Boris Zakharin | last post: by
3 posts views Thread by =?Utf-8?B?VmFuZXNzYQ==?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.