quadomatic
New member
- Local time
- Today, 15:26
- Joined
- Jun 20, 2010
- Messages
- 2
Hey all,
I have a bunch of records in multiple tables. Each record has an identifier. I have another table with the same identifiers, that has some fields which are basically used for yes or no to certain criteria (using 1 for yes and 0 for no).
I want a query that can pull data from each table based on one of those criterion. I was trying to write a query that would work by prompting the user to input a field name, and then the query would pull records limited to those which meet the criteria.
Here's the SQL I wrote:
SELECT [Table_With_Many_Records].*
FROM CriteriaTable, [Table_With_Many_Records]
WHERE [Table_With_Many_Records].id=[CriteriaTable].id AND [CriteriaTable].[]=1;
Is there a way for the user to be able to input that field name? I get it to prompt for input, but it tells me the expression is typed incorrect or is too complex to be evaluated. Any help?
I have a bunch of records in multiple tables. Each record has an identifier. I have another table with the same identifiers, that has some fields which are basically used for yes or no to certain criteria (using 1 for yes and 0 for no).
I want a query that can pull data from each table based on one of those criterion. I was trying to write a query that would work by prompting the user to input a field name, and then the query would pull records limited to those which meet the criteria.
Here's the SQL I wrote:
SELECT [Table_With_Many_Records].*
FROM CriteriaTable, [Table_With_Many_Records]
WHERE [Table_With_Many_Records].id=[CriteriaTable].id AND [CriteriaTable].[]=1;
Is there a way for the user to be able to input that field name? I get it to prompt for input, but it tells me the expression is typed incorrect or is too complex to be evaluated. Any help?