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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Error Only When running Report

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,208
US
I hate it when Access does this...

The specified field '<Field Name Here>' could refer to more than one table in the from clause of your SQL statement.

The field is grouped on in the report and is joined in the record source query. In those sub-queries (query objects), the field is calculated (via IIF) and aliased back to a field name used in the calculation.

The record source executes fine on its own. I kind of see how the report could get confused. I'll play with it but does anyone have ideas to fix it or know how the report object runs statements to group?

I am hoping this all means something to someone who can help as I bet it would take forever to explain everything behind the queries.
 
Why not just qualify the offending column name in the query eg Yourtablename.[ColumnName]

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
It is except where aliased and then I use the FQN in the grouping for the report. This seems odd (it is the only column in the query with that field name) but it is what is available in the list.
 
If I alias Field to Field2 and fix all the control sources and Report Grouping, it works.

I hate weird.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top