Yes, you need to create a "calculated field" in the query. In the design
grid you would enter something like this for the field.
EthnicityText:Function([Ethnicity])
The function could be a user defined function or a built-in function. If the
numbers you mention are sequential, I would recommend the Choose() function.
Example:
EthnicityText:Choose([Ethnicity], "White English", "choice 2", "choice 3",
"choice n")
If they aren't sequential, try the Switch() function.
Example:
EthnicityText:Switch([Ethnicity]=1, "White English", [Ethnicity]=4, "choice
2")
Either of these will result in a field in your query's output called
"EthnicityText". There is a colon in the syntax after "EthnicityText".
A "user defined function" would be one that you create in a VBA module. You
would call it just as the function above are called. You would need to pass
the value of the [Ethnicity] field as its argument.
--
Wayne Morgan
MS Access MVP
rhys said:
hi, can any one tell me how to decode data. i have a field in a query
that
contains ethnicity. the data is entered in number form and i want to
decode
this so that when my query is run it displays the text (ie, white english
instead of 1). is there a way to do this using the query design builder
and
not sql??