"sbligh" <sb****@canoemail.com> wrote in message
news:11**************************@posting.google.c om...
Do any of you know if it's possible to get the name of your field from
another table?
E.g.
Select FYear as [Select description from YearTable where category=1]
I need the name of the fields to be user defined and the only way I
can see this happening is through a table. But now...how do I get the
field name from the table?
Any help would be appreciated!!!!
Thank you,
Susan
Is this what you need?
select description as 'FYear'
from YearTable
where category=1
Or are you asking if you can store the name of a column or table to be
queried in a table? In that case, you would need dynamic SQL, but it's
generally not recommended:
http://www.sommarskog.se/dynamic_sql.html#Dyn_table
Simon