I am trying to create a SQL statement in my query that will get a string from another query (Here query2) and use that string to change the field name within the SQL statement. In the example below I want the query to substitute the field ChangeMe to the string from query2.
SELECT query1.[ChangeMe], query1.[Something], query1.[SomethingElse] FROM query1;
__1st__GUESS___________________________________________
My first guess was to use DLookup to retrieve the string from a table and then place that string in the SQL statement.
SELECT query1.[(DLookup("[String]", "tblString)]
FROM query 1;
This attempt didn't work, but it illustrates what I'm trying to achieve. Any ideas on how I can achieve this goal?
Thanks in advance for your help.
SELECT query1.[ChangeMe], query1.[Something], query1.[SomethingElse] FROM query1;
__1st__GUESS___________________________________________
My first guess was to use DLookup to retrieve the string from a table and then place that string in the SQL statement.
SELECT query1.[(DLookup("[String]", "tblString)]
FROM query 1;
This attempt didn't work, but it illustrates what I'm trying to achieve. Any ideas on how I can achieve this goal?
Thanks in advance for your help.