Query Code

davidoc

Registered User.
Local time
Today, 03:04
Joined
Nov 14, 2003
Messages
25
Hi,

I am trying to use code in a query to determine which fieldname to select:

Select Table1.[MyFunction] From Table1

Its isn't working and I haven't been able to find any past postings on the topic to help me. It is obviously something with the syntax (I know the function works if I use in a WHERE condition.

any help would be much appreciated!

Dave
 
davidoc said:
Hi,

I am trying to use code in a query to determine which fieldname to select:

Select Table1.[MyFunction] From Table1

Its isn't working and I haven't been able to find any past postings on the topic to help me. It is obviously something with the syntax (I know the function works if I use in a WHERE condition.

any help would be much appreciated!

Dave

SELECT [MyFunction].MyFunction
FROM [Table1];

I think
 
No thats not it. Maybe I have explained it badly. MyFunction() returns a value and I want to use that value to identify a field in a table. i.e. if I have a table with three fields a,b,c I want MyFunction to return one of those from an unrelated calculation so that my Query (SELECT Table1.MyFunction() FROM Table1) will give me a single column from the appropriate field.

Dave
 

Users who are viewing this thread

Back
Top Bottom