I have a user-defined function (in Microsoft Access) that takes a value from two fields and returns a string, which corresponds to a column name.
This might not seem very clear; below is a simplified example of what I'm trying to do. Unfortunately I can't use the real problem as it's confidential.
Input:
Num1 | Num2 | Field1 | Field2 | Field3 | Field4 | Field5 .....|......|........|........|........|........|....... .....|......|........|........|........|........|....... .....|......|........|........|........|........|....... SQL query: "SELECT Num1,Num2,Func(Num1,Num2)
Output:
Num1 | Num2 | FieldVal
In the output, FieldVal can be the value of Field1,Field2,Field3,Field4, or Field5, depending on Num1 and Num2. As of now I have a user defined function that determines which field's being used(1,2,3,4,or 5) based on two inputs (Num1 and Num2).
I guess what I'm trying to say is that I want to query a different column depending on Num1 and Num2.
Func()
and have it determine which one of those to return? – Tim Williams