wat3rfall6
Registered User.
- Local time
- Today, 19:25
- Joined
- Oct 4, 2010
- Messages
- 13
Hello Everybody!
I use Access 2007 + Windows XP.
How can I make a select query and sort the results the way I like and escape the default ascending sort of Access?
For example I give this command:
SELECT names.* FROM names
WHERE address = "Hamilton 20" OR address = "Varick 43" OR address = "Alion 10"
ORDER BY CASE
WHEN address = "Hamilton 20" THEN 1
WHEN address = "Varick 43" THEN 2
WHEN address = "Alion 10" THEN 3
END
It works in SQL but not in Access. It shows the following error message:
Syntax error (missing operator) in query expression CASE
WHEN address = "Hamilton 20" THEN 1
WHEN address = "Varick 43" THEN 2
WHEN address = "Alion 10" THEN 3
END
Which is the syntax error? Any help would be kindly appreciated.
Thanx in advance
I use Access 2007 + Windows XP.
How can I make a select query and sort the results the way I like and escape the default ascending sort of Access?
For example I give this command:
SELECT names.* FROM names
WHERE address = "Hamilton 20" OR address = "Varick 43" OR address = "Alion 10"
ORDER BY CASE
WHEN address = "Hamilton 20" THEN 1
WHEN address = "Varick 43" THEN 2
WHEN address = "Alion 10" THEN 3
END
It works in SQL but not in Access. It shows the following error message:
Syntax error (missing operator) in query expression CASE
WHEN address = "Hamilton 20" THEN 1
WHEN address = "Varick 43" THEN 2
WHEN address = "Alion 10" THEN 3
END
Which is the syntax error? Any help would be kindly appreciated.
Thanx in advance
