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

query of queries space in column

Status
Not open for further replies.

bmc1234

Programmer
Jul 21, 2005
50
US
I have to write a query of queries to select aggregates from a query. the query may have spaces in the column names and qoq doesn't seem to like this. How can I do something like the following

Code:
select sum(col with space)
from qry1
using query of queries

I've tried surrounding it in brackets like you do with reserved keywords but it still errors.

Any help would be appreciated. Thanks.
 
get rid of the space in the original query

qry1:

select [col with space] as newColName

qry2:

select sum(newColName)
from qry1

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
so the answer is, it's not possible. I was hoping for a better solution. I don't necessarily have control over the fields in the first query, so it sounds like I'd have to create a new query parse through it and change the names.

Anybody know of a solution for this?
 
No it won't work the way you hoped because a QofQ is actually a reference to the source query, not an actual new array populated with data. Therefore, the column names you provide to the QofQ will be matched, literally, as the QofQ references Q1.



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top