Link to home
Start Free TrialLog in
Avatar of tncode
tncodeFlag for United States of America

asked on

How to ORDER BY after comparing two fields

Hello

I  am trying to create a report that will produce information about the cars in our shop.  In my report, I am trying to pull a report and order by   all of the cars that have not been driven at all, all of the cars that have been driven initially by a test driver and the most recent driver who is a manager, and then all cars that have been driven most recent to the oldest.  It is possible that the manager.driver is also the tester.testdriver. So, I want to have this ordered in my report after I see a list of all the cars that have not been driven.  How to I check to see if two fields are equivalent and order them?  If you need more information let me know.

In my ORDER BY, I have

ORDER BY cars.driven is null desc,tester.testdriver == manager.driver , tester.testdriver desc
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tncode

ASKER

Thanks!!!