Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 ORDER BY

Author  Topic 

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2002-08-20 : 16:32:20
I program in c++, ado, and aceess. I need to do a query and sort on multiple fields. I cannot figure out how to do this and cannot find anything in access help!


SELECT * FROM MyTable
WHERE ShippingDate = #%s#
AND ProjectID = '%s'
AND ComponentID = '%s'
ORDER BY Stack ASC, ORDER BY Level DESC, ORDER BY Position ASC"


How can I do this?

Mike B
Is it not possible to do this?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-08-20 : 16:42:23
You only need to specify ORDER BY once:
SELECT * FROM MyTable
WHERE ShippingDate = #%s#
AND ProjectID = '%s'
AND ComponentID = '%s'
ORDER BY Stack ASC, Level DESC, Position ASC


Go to Top of Page

Doug G
Constraint Violating Yak Guru

331 Posts

Posted - 2002-08-22 : 16:29:30
You can let access build you an example if you make a query doing approximately what you want, then opening SQL view on that query.


======
Doug G
======
Go to Top of Page
   

- Advertisement -