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

multiple records side by side

Status
Not open for further replies.

Dorian123

Programmer
Dec 8, 2002
4
DE
Hi,

I have a table looking like this:

month value1 value2 value3
-------------------------------
1 33 45 7
2 4 77 46
3 5 99 12

And i want to have a report looking like this:

month 1 2 3
-------------------------------
value1 33 4 5
-------------------------------
value2 45 77 99
-------------------------------
value3 7 46 12

How can help me?!

Thx
 
Try creating a Crosstab query with the table. Select New Query and then look for the Crosstab Query wizard. Select the Values for your row heading and the Month for your column headings.

Paul
 
Dorian,
Here is a FAQ on the subject of crosstab queries.
faq703-2868
HTH,
Randy Smith
California Teachers Association
 
Thank you for your responses.

I tried to understand crosstab queries and to solve my problem. But i wasn't successful. Maybe you can send me the query for my problem above.

Thank you!!!
 
Hi,
Are the exact steps you want to follow:
1) Go to the Query object, and click New.
2) Select Crosstab Query Wizard, then click Ok
3) It will then ask for the table that contains the fields you want to appear. In your case, it appears as though you are only using one table. Go ahead and select that table.
4) Then select the fields you want as row headings. In your case, this would be the value (you showed value1, value 2, value 3). You can select up to three fields. Click Next.
5) You will now be asked for the fields to be used as column headings. In your case, this is the month. Click Next.
6) You will now be asked to select a field for the calculations for each row/column intersection. For you, this is the field that contains the values 33, 4, 5. You can also pick a function to be used (e.g., avg, count and sum are generally the most frequently used). Click Next.
7) Finally, give the query a name, and click "View the query", then click Finish.
8) If you like the results, simply save the query, then go to the Report object and create a new report. Use the wizard to use your new crosstab query as the recordsource (where it says "Choose the table or query where the......" is located. Access will take care of all the column headings.
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top