Crosstab Query -- Urgent!! Help needed.......

B

bpan007

I have a crosstab query which sums up all manufacture's sales QTY. The
query is as follows:
=========================================

TRANSFORM Sum( sales_rpt_history.Total_Cases) AS SumOfTotal_Cases
SELECT sales_rpt_history.MFR_Name, Sum( sales_rpt_history.Total_Cases) AS
[Total Of Total_Cases]
FROM sales_rpt_history, Max_date, Min_Date_12
WHERE (((
sales_rpt_history.Deliver_date)>[Min_Date_12].[MinOfMinOfDeliver_date] And
( sales_rpt_history.Deliver_date)<[Max_date].[maxdate])
GROUP BY BPAN007_sales_rpt_history.MFR_Name
ORDER BY Format([deliver_date]," mmm")
PIVOT Format([deliver_date]," mmm") In
("001","002","003","004","005","006","007","008","009","010","011","012");
 
D

Duane Hookom

I don't see how you could be getting any results since your expression
Format([DateField]," mmm") will return somethin like " Jul". Your "In"
statement has 001, 002,...
Will you have multiple years represented so there is a possibility of more
than 12 column headings generated?
You might consider using a column heading expression like
ColHead: "M" & Format(DateDiff("m", [Deliver_Date], Date()),"00")
This will create columns with headings like "M01","M02",...
 

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