I've got a query that I'm using to track if certain tasks are completed. A task is completed based on different fields being populated. I have a table that lists which field to look for. My current solution is to use a public function to determine which field to look for and then check if there is a value in that field. The only issue is that using a function for a bunch of records decreases the performance. I'm hoping that someone knows some trick to be able to do it via SQL.
For some examples, let say I have a table of customers (tblCustomers) with several fields
Then we have a table listing all the tasks and then the field name to look into for a value
Is there a way for SQL to know to look in CustomerName for the task Name Entered? It is easy with VBA, but I can't think how to do it in SQL.
For some examples, let say I have a table of customers (tblCustomers) with several fields
Code:
[U]tblCustomers[/U] CustomerName BirthDate SSN FavoriteColor
Code:
[U]tblTasks[/U] [B]TaskDescription TaskField[/B] Name Entered CustomerName Birthday Provided BirthDate SSN Entered SSN Favorite Color Provided FavoriteColor
Comment