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!

using result of a query as columns in a new query...

Status
Not open for further replies.

Netooi

Programmer
May 15, 2002
29
US
I have a query that is going to return no more than 4 results... for Example

Select Items from tblItems

This query returns:

table
chair
desk
seat

I want to be able to take this result and use it as columns in a new query.. How would I go about using this..

Something like
Select ??? as row1, ??? as row2, ??? as row3, ??? as row4
from sometable

where the value in row1 of the new query would equal table, row2 would equal chair, etc...
Also, in case the query didnt returned less than 4 rows,
maybe it only returned 2 rows, then the value of row3 would be blank and row4 would be blank.

Any suggestions?

Thanks for any help,
Netooi
 
How are ya Netooi . . . . .

Easy!

In [blue]Query Design View[/blue] when you right click on the area where tables would go and select [blue]Show Table[/blue], a dialog pops-up with three tabs (Tables, Queries, and Both). Select the [blue]Queries Tab[/blue], and insert the query of your choice. This works the same as selecting a table, only your selecting a query. Treat the query as a table and drag fields as required to the field line.

cal.gif
See Ya! . . . . . .
 
Perhaps are you talking about crosstab query (PivotTable) ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top