troubleshooting Question

Need help with an order by clause in access 2007

Avatar of dzirkelb
dzirkelbFlag for United States of America asked on
DatabasesMicrosoft AccessSQL
27 Comments1 Solution431 ViewsLast Modified:
I am running a query where I would want the results to be ordered in the order of the where clause statement, is this something possible?

Currently, this is what I have:
SELECT Field, Description, DataType, MaximumLength, PointsPossible FROM SchemaInfo WHERE (TableName = 'VideoShopData') AND ([Field] = 'Restaurant') OR ([Field] = 'ShopDate') OR ([Field] = 'AmountSpent') OR ([Field] = 'PKID') OR ([Field] = 'ShopStartTime') OR ([Field] = 'Item1') OR ([Field] = 'Item2') OR ([Field] = 'Item3') OR ([Field] = 'Item4') OR ([Field] = 'Drink') OR ([Field] = 'Item1Temp') OR ([Field] = 'Item2Temp') OR ([Field] = 'Item3Temp') OR ([Field] = 'Item4Temp') OR ([Field] = 'DrinkBrix') OR ([Field] = 'Item1Weight') OR ([Field] = 'Item2Weight') OR ([Field] = 'Item3Weight') OR ([Field] = 'Item4Weight') OR ([Field] = 'FriendlyGreeting') OR ([Field] = 'FriendlyGreetingNotes') OR ([Field] = 'AppreciativeClosing') OR ([Field] = 'AppreciativeClosingNotes') OR ([Field] = 'EmployeesBehavingProfessionally') OR ([Field] = 'EmployeesBehavingProfessionallyNotes') OR ([Field] = 'CustomersTreatedRespectfully') OR ([Field] = 'CustomersTreatedRespectfullyNotes') OR ([Field] = 'EmployeeAppearance') OR ([Field] = 'EmployeeAppearanceNotes') OR ([Field] = 'TranslationCorrect') OR ([Field] = 'TranslationCorrectNotes') OR ([Field] = 'ParkingLot') OR ([Field] = 'ParkingLotNotes') OR ([Field] = 'BuildingExterior') OR ([Field] = 'BuildingExteriorNotes') OR ([Field] = 'DriveThru') OR ([Field] = 'DriveThruNotes') OR ([Field] = 'FrontCounter') OR ([Field] = 'FrontCounterNotes') OR ([Field] = 'SelfService') OR ([Field] = 'SelfServiceNotes') OR ([Field] = 'OutOfProduct') OR ([Field] = 'OutOfProductNotes') OR ([Field] = 'OrderAccurate') OR ([Field] = 'OrderAccurateNotes') OR ([Field] = 'Appearance') OR ([Field] = 'AppearanceNotes') OR ([Field] = 'Portioning') OR ([Field] = 'PortioningNotes') OR ([Field] = 'Temperature') OR ([Field] = 'TemperatureNotes') OR ([Field] = 'GreetedWithinLimit') OR ([Field] = 'GreetedWithinLimitNotes') OR ([Field] = 'CustomerCount') OR ([Field] = 'TotalServiceTimeMinutes') OR ([Field] = 'TotalServiceTimeSeconds') OR ([Field] = 'PositiveFeedback') OR ([Field] = 'OverallComments')

It has a couple of the comments fields in the beginning of the results, when I want the results to be ordered in the order of the where statment of the Field = xxx.

is this possible or do I have to add another field to do the sort manually?

This is an access 2003 database.  I am basically creating my own schema info like I would in sql server.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 27 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 27 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros