Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specified Field could refer to more than one table

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I am using the following formula in a query. When I run the query the message say Specified field could refer to more than one table. The field PayInd is in two tables in the query. Is there a way to reference the field so the system know which PayInd field is being tested and avoid this problem?

Dty St: IIf(nz([PayInd],"")="Y","N","")
 


Hi,
Code:
Select  IIf(nz(A.[PayInd],"")="Y","N","")
From [table 1] A
,    [table 2] B


Skip,

[glasses] [red][/red]
[tongue]
 
Dty St: IIf(nz([!][TableName].[/!][PayInd],"")="Y","N","")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Just reference the table:
Code:
Dty St: IIf(nz([COLOR=blue][correcttablename].[/color][PayInd],"")="Y","N","")

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thanks for the responses. While I was waiting those short few minutes I tested:
Dty St: IIf(nz(correcttablename.PayInd,"")="Y","N","")

without any brackets at all and it worked fine. Could this be because I am using Access2003, because there are just multiple ways of doing it or do you think it will come back and bite me when using real world data?

Thanks
 
You MUST use the brackets of the table name (or field name) contains spaces or special characters or they are reserved words (e.g. Date, Year, User, Year-End, etc.) They are optional otherwise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top