Vassago
Former Staff Turned AWF Retiree
- Local time
- Today, 11:49
- Joined
- Dec 26, 2002
- Messages
- 4,696
Okay! I've had it up to here! I was trying my hardest to get this to work on my own, but it looks like my efforts are failing.
This is my very detailed and complicated problem:
I have a table called tbl_pending with the following fields:
Resolved_Date
Mail_Type
Mail_ID
I also have a table called RunData with the following fields:
Start_Date
End_Date
Basically, I need a report based from these two tables that has a format similar to this:
Mail Type Jan 03 | Feb 03 | Mar 03
Address Change 100 | 105 | 110
Doc Only 225 | 230 | 190
Totals 325 | 335 | 300
The date at the top is coming from the Resolved_Date field as long as it is between Start_Date and End_Date. The number is a count of the Mail_ID. I have the following query that gives me kind of what I need, but I can't figure out how to take this data and place it in a report with the above format.
SELECT (Format([Resolved_Date],"mmm"" '""yy")) AS ResolvedMonth, tbl_pending.Mail_Type, Count(tbl_pending.Mail_ID) AS CountOfMail_ID
FROM tbl_rundata, tbl_pending
WHERE (((tbl_pending.Resolved_Date) Is Not Null And (tbl_pending.Resolved_Date) Between [Start_Date] And [End_Date]))
GROUP BY (Format([Resolved_Date],"mmm"" '""yy")), tbl_pending.Mail_Type, (Year([Resolved_Date])*12+Month([Resolved_Date])-1)
ORDER BY (Year([Resolved_Date])*12+Month([Resolved_Date])-1);
Does anyone out there know how to make this work? I was thinking a crosstab query, but since the date is completely choosable by the user, I don't think that would work.
Any help with this would be greatly appreciated.
Thanks in advance!
Vassago
This is my very detailed and complicated problem:
I have a table called tbl_pending with the following fields:
Resolved_Date
Mail_Type
Mail_ID
I also have a table called RunData with the following fields:
Start_Date
End_Date
Basically, I need a report based from these two tables that has a format similar to this:
Mail Type Jan 03 | Feb 03 | Mar 03
Address Change 100 | 105 | 110
Doc Only 225 | 230 | 190
Totals 325 | 335 | 300
The date at the top is coming from the Resolved_Date field as long as it is between Start_Date and End_Date. The number is a count of the Mail_ID. I have the following query that gives me kind of what I need, but I can't figure out how to take this data and place it in a report with the above format.
SELECT (Format([Resolved_Date],"mmm"" '""yy")) AS ResolvedMonth, tbl_pending.Mail_Type, Count(tbl_pending.Mail_ID) AS CountOfMail_ID
FROM tbl_rundata, tbl_pending
WHERE (((tbl_pending.Resolved_Date) Is Not Null And (tbl_pending.Resolved_Date) Between [Start_Date] And [End_Date]))
GROUP BY (Format([Resolved_Date],"mmm"" '""yy")), tbl_pending.Mail_Type, (Year([Resolved_Date])*12+Month([Resolved_Date])-1)
ORDER BY (Year([Resolved_Date])*12+Month([Resolved_Date])-1);
Does anyone out there know how to make this work? I was thinking a crosstab query, but since the date is completely choosable by the user, I don't think that would work.
Any help with this would be greatly appreciated.
Thanks in advance!
Vassago
Last edited: