469,271 Members | 1,009 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

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 52121
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.