Complex query, strange column problem

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I am trying to help someone with their database. They have a complex query
which pulls columns from several other queries/tables and combines them into
one query.

The strange thing is that one of the columns comes up as "qryWord.Attorney",
instead of simply "Attorney".

I have looked at this thing for some time now and have not found any other
columns named "Attorney". I even converted the query to SQL and used a text
editor to look for all occurrences of the word "Attorney". I only found the
one name "Attorney" along with several other columns named like
"AttorneyInnitials", "AttorneyID", etc.

I also exported the query to Excel and looked at the headings there, and
there is no "Attorney" column heading. The one field which is named
"Attorney" becomes "qryWord.Attorney".

I have also removed every field in the query, except for the "Attorney"
field. Yet, it still shows up as "qryWord.Attorney" in the column heading.

The only way I can get it to show as "Attorney", is to remove one of the
queries being joined. Even if no field from that query is in the data grid,
it still shows up as query.field in the column heading, the query can't be
part of the relationship at all for it to work.

The query that I remove, to get this to work, doesn't even have an Attorney
field in it at all. And of course, it's required, so I can't really remove
it as a solution.

So what the heck can be going on? Any ideas?
 
From the looks of it you are joining to a prevously made query Named "qryWord" that is using an alias of a column that someone named "Attorney". Try looking for the existing qry and take it from there.
 
Yeah, qryWord pulls data from 4 tables together, including the field
"Attorney" from one of the tables. That query is then used in this query,
which joins it to another query to produce the required output.

If you are saying that I should pull the data directly from the tables, like
qryWord is already doing, I don't see how that will help, plus it would mean
creating the same query in two places. That's not a good idea in a database.

I should be able to join those two queries, without a problem. I've done
this same type of thing for 10+ years in Access!

I will give you suggestion a try, just to see if it works, though.

zack said:
From the looks of it you are joining to a prevously made query Named
"qryWord" that is using an alias of a column that someone named "Attorney".
Try looking for the existing qry and take it from there.
 
Ok, I tried your suggestion.

Basically, I simply added the additional query to the original query, which
pulls all the tables together. Now, I the "Attorney" column becomes
"Attorney.Attorney", which is the name of the table and column, instead of
the query and column.

So, the same thing is happening when I add the additional query, even though
that query does not contain Attorney!

argh!
 
Back
Top