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

referring to alias names in subquery from outer query

Status
Not open for further replies.

Earth

Technical User
May 8, 2000
59
AU
Hi everyone,

I have a query that has a subquery. The subquery is only returning two columns: one is a calculated column, and the other is the original column. I have given the calculated column an Alias.

Quick question: Can I refer to this calculated column by alias name in the outer query? Access (2000) doesn't seem to like it.

Thanks in advance.

 
Refering to the Alias name in the outer query should be fine. If you join the subquery to another table or subquery, make certain that the alias name is not duplicated with the name of another field in the other table. Try placing brackets around the alias name in the subquery and the name of the field in the outer query. You may have inadvertently used a reserved word as your alias (for example [Number] or [Count]).

What sort of error message are you getting?
 
Hi Dalchri,

I figured it out. Yes, I could refer to an inner query alias in the outer query. (I tested this by giving the original column and alias, and I could refer to it in the outer query). My problem came from some where else (trying to sum date values actually!).

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top