Need to create a report using a crosstab query

M

mjps

I'm new on the boards ... I'm trying to create a reporting using the wizard
from a crosstab query with the following SQL information:

PARAMETERS [Forms]![frm_stmt]![stmt] Text ( 255 );
TRANSFORM Sum([TOTAL ANNUAL].[2005YE]) AS SumOfDec 05
SELECT tbl_Statement.STMT, [TOTAL ANNUAL].Item
FROM ([TOTAL ANNUAL] INNER JOIN [Items - Order] ON [TOTAL ANNUAL].Item =
[Items - Order].Item) INNER JOIN tbl_Statement ON ([TOTAL ANNUAL].STMT =
tbl_Statement.STMT_short) AND ([Items - Order].STMT = tbl_Statement.STMT)
WHERE (((tbl_Statement.STMT)=[Forms]![frm_stmt]![stmt]))
GROUP BY tbl_Statement.STMT, [Items - Order].Order, [TOTAL ANNUAL].Item
ORDER BY tbl_Statement.STMT, [Items - Order].Order
PIVOT [TOTAL ANNUAL].CO;

The problem is, none of the fields are available for me me to select to
create the report ... it's blank. When I try to create a report using design
view, the pop-up box for parameter I set keeps coming up everytime I try to
move a field onto the report.
 
A

Allen Browne

In query design view, open the Properties box.
Beside the Column Headings property, list all the valid values that could
appear in the Column Headings field.
Save the query.

Since these headings are the field names, the query will not generate all
the fields, even if there is no data for some of them. And since the query
knows what the fields are without having to run all the data, the report
will also know what fields the query will provide.
 
M

mjps

Thank you, Allen! That worked perfectly!

Allen Browne said:
In query design view, open the Properties box.
Beside the Column Headings property, list all the valid values that could
appear in the Column Headings field.
Save the query.

Since these headings are the field names, the query will not generate all
the fields, even if there is no data for some of them. And since the query
knows what the fields are without having to run all the data, the report
will also know what fields the query will provide.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mjps said:
I'm new on the boards ... I'm trying to create a reporting using the
wizard
from a crosstab query with the following SQL information:

PARAMETERS [Forms]![frm_stmt]![stmt] Text ( 255 );
TRANSFORM Sum([TOTAL ANNUAL].[2005YE]) AS SumOfDec 05
SELECT tbl_Statement.STMT, [TOTAL ANNUAL].Item
FROM ([TOTAL ANNUAL] INNER JOIN [Items - Order] ON [TOTAL ANNUAL].Item =
[Items - Order].Item) INNER JOIN tbl_Statement ON ([TOTAL ANNUAL].STMT =
tbl_Statement.STMT_short) AND ([Items - Order].STMT = tbl_Statement.STMT)
WHERE (((tbl_Statement.STMT)=[Forms]![frm_stmt]![stmt]))
GROUP BY tbl_Statement.STMT, [Items - Order].Order, [TOTAL ANNUAL].Item
ORDER BY tbl_Statement.STMT, [Items - Order].Order
PIVOT [TOTAL ANNUAL].CO;

The problem is, none of the fields are available for me me to select to
create the report ... it's blank. When I try to create a report using
design
view, the pop-up box for parameter I set keeps coming up everytime I try
to
move a field onto the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top