- Local time
- Today, 03:45
- Joined
- Jul 9, 2003
- Messages
- 16,285
This SQL is getting a bit advanced for me, so I was wondering if anyone could give me some pointers.
I have two queries:
qryDonDateRange (a select query)
qryDonationCrosstab (a cross tab query)
the cross tab query is based on the select query. However I want to reproduce these queries in the module, but I have no idea how to combine them!
the SQL of these queries is:
Any comments suggestions or advice gratefully received!
Cheers Tony.
I have two queries:
qryDonDateRange (a select query)
qryDonationCrosstab (a cross tab query)
the cross tab query is based on the select query. However I want to reproduce these queries in the module, but I have no idea how to combine them!
the SQL of these queries is:
Code:
'>>> qryDonDateRange <<<
SELECT DatePart("m",[PaymentDate]) AS [Month], tlkpInfo.tlkpInfoDesc AS Donation, tblDonations.PaymentAmount AS Amount
FROM tlkpInfo INNER JOIN tblDonations ON tlkpInfo.tlkpInfoID = tblDonations.DonationcodeID
WHERE (((tblDonations.PaymentDate) Between #1/1/2006# And #1/1/2007#));
'>>> qryDonationCrosstab <<<
TRANSFORM Sum(qryDonDateRange.Amount) AS SumOfAmount
SELECT qryDonDateRange.Donation
FROM qryDonDateRange
GROUP BY qryDonDateRange.Donation
PIVOT qryDonDateRange.Month;
Any comments suggestions or advice gratefully received!
Cheers Tony.