Evaluating text within an SQL statement for Microsoft Access
Posted on 2003-03-03
The problem I am working on is quite complicated, so I will illustrate it with a simpler example.
I have a table called Properties with fields Name and Value. Here is what I want to do:
SELECT Value As Name FROM Properties WHERE ID = 1
But obviously Access throws this error (The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. (Error 3141)).
Is there a way to force Access to evaluate the text that Name represents? Name should be the Name of the property and I would like to display it as the header for my results.
ID Name Value
1 Color Blue
2 Width 5
3 Length 10
And would like the results of the query to be:
Please let me know if this is unclear and I will post more details.