C
Clark
I use the Access query generator to mostly generate SQL statements for use in
the FP DRW,
In a simple Database Results region, I am trying to bring up records showing
data from the MDName, City, and State fields except where someone has selected
"no" in a ShowCity field, in which situation I want to show the word
"Unavailable" instead of their city.
Bought a Learning SQL book, dug out the CLASS statement which looks to fill the
bill, tried it six ways 'till Sunday by modifying the SQL view in the Access
Query Builder and could never make it work.
After 2 or 3 hours of this, dug out my excellent Alison Dolan Access 2000
Development book and to my surprise, not a peep about conditional CLASS
statements in it.
So to the question: Can you use the CLASS statement in an Access query?
For the record, here is my failed SQL statement:
SELECT Results.MDName, CLASS When Results.City Is Not Null and When
Results.ShowCity = 'No' THEN 'Unavailable' ELSE Results.City END, Results.State
FROM Results
ORDER BY Results.MDName;
I've tried it with both Apostrophes and Quote marks, no luck either way.
Is something (probably) wrong with my approach? Is there a better way (I guess
there has to be :=)
Thanks
Clark
the FP DRW,
In a simple Database Results region, I am trying to bring up records showing
data from the MDName, City, and State fields except where someone has selected
"no" in a ShowCity field, in which situation I want to show the word
"Unavailable" instead of their city.
Bought a Learning SQL book, dug out the CLASS statement which looks to fill the
bill, tried it six ways 'till Sunday by modifying the SQL view in the Access
Query Builder and could never make it work.
After 2 or 3 hours of this, dug out my excellent Alison Dolan Access 2000
Development book and to my surprise, not a peep about conditional CLASS
statements in it.
So to the question: Can you use the CLASS statement in an Access query?
For the record, here is my failed SQL statement:
SELECT Results.MDName, CLASS When Results.City Is Not Null and When
Results.ShowCity = 'No' THEN 'Unavailable' ELSE Results.City END, Results.State
FROM Results
ORDER BY Results.MDName;
I've tried it with both Apostrophes and Quote marks, no luck either way.
Is something (probably) wrong with my approach? Is there a better way (I guess
there has to be :=)
Thanks
Clark