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!

Move field values to field headings 1

Status
Not open for further replies.

wahooguy

MIS
May 11, 1999
55
US
I have a table with the following fields: ID#, Name, Date, Service. There are no primary keys so values can be repeated. The values for Service can be: tuneup, lube, oil, checkup. The format of the database can't be changed.<br>I now need to develop a report that lists each Name with the number of each type of service as follows:(sorry if tabs are bad)<FONT FACE=monospace><br>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tuneup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lube&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Oil&nbsp;&nbsp;&nbsp;&nbsp;Checkup<br>John&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br>Sue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br>etc.<br></font><br>Is there any way this can be accomplished through queries or SQL? Should I try modules in a report? So far with SQL I can generate a report by name and group but not formatted as desired:<FONT FACE=monospace><br>Name<br>John<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tuneup&nbsp;&nbsp;&nbsp;2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lube&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Oil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checkup&nbsp;&nbsp;1<br>Sue<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tuneup&nbsp;&nbsp;&nbsp;0<br>etc.<br></font><br>Any suggestions would be greatly appreciated. I don't have much hair left!<br>
 
Try a crosstab query.&nbsp;&nbsp;If you've never tried using one, try the Crosstab query wizard.&nbsp;&nbsp;It should help out.
 
Awesome, Ymesei. You hit it right on the head. I had looked at that but didn't think I was on the right track. You made me really dig into crosstab queries and understand it better. Thanks for the quick response - I should have asked you before the receding hairline!!<br><br>wahooguy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top