By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,561 Members | 948 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,561 IT Pros & Developers. It's quick & easy.

How to "ORDER BY" in descending order?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.