T
Tor Inge Rislaa
John Viescas was so kind to reply with this solution to my question
yesterday:
SELECT MyValue, Choose([MyValue] - 1, "External", "Internal") As
ValueDescription
FROM MyTable
I can't find any reference to the command CHOOSE. I would appreciate if
someone could give me a description on the Syntax for the command CHOOSE so
that I could understand how it works. Is it for instance possible to
evaluate more than two values and so on.?
REF my question yesterday:
I have an simple query as below:
SELECT MyValue
FROM MyTable
Based on the value in the field MyValue I want to add a value to a new
column in the result of the query.
Example:
If the value in MyValue = 0 then I would add the text "External"
If the value in MyValue = 1 then I would add the text "Internal"
I what to see the same result as the query below (on the fly), without using
union all:
SELECT MyValue, "External" AS ValueDescription
FROM MyTable
WHERE MyValue = 0
UNION ALL
SELECT MyValue, "Internal" AS ValueDescription
FROM MyTable
WHERE MyValue = 0
yesterday:
SELECT MyValue, Choose([MyValue] - 1, "External", "Internal") As
ValueDescription
FROM MyTable
I can't find any reference to the command CHOOSE. I would appreciate if
someone could give me a description on the Syntax for the command CHOOSE so
that I could understand how it works. Is it for instance possible to
evaluate more than two values and so on.?
REF my question yesterday:
I have an simple query as below:
SELECT MyValue
FROM MyTable
Based on the value in the field MyValue I want to add a value to a new
column in the result of the query.
Example:
If the value in MyValue = 0 then I would add the text "External"
If the value in MyValue = 1 then I would add the text "Internal"
I what to see the same result as the query below (on the fly), without using
union all:
SELECT MyValue, "External" AS ValueDescription
FROM MyTable
WHERE MyValue = 0
UNION ALL
SELECT MyValue, "Internal" AS ValueDescription
FROM MyTable
WHERE MyValue = 0