R
rpw
Hi all,
I don't know how to go about this and would really appreciate help on it. I
have a table with the following fields:
Territory
DateRecd
ApptDate
SaleDate
JobTotal
What I would like to do is have a query that will sum by month on the
SaleDate field, group by Territory and also count the DateRecd, ApptDate, and
SaleDate that match the summed month.
Some SaleDate records are null and it's possible some ApptDate records are
also.
Here is the SQL I have so far for summing the sales by month, I need the
help on how to get the counts of the date fields included somehow.
SELECT qryAllentown.Territory, Sum(qryAllentown.JobTotal) AS [SumOfJob
Total],
DateSerial(Year(qryAllentown![SaleDate]),Month(qryAllentown![SaleDate]),1) AS
SortMonth
FROM qryAllentown
WHERE ((Not (qryAllentown.SaleDate) Is Null))
GROUP BY qryAllentown.Territory,
DateSerial(Year(qryAllentown![SaleDate]),Month(qryAllentown![SaleDate]),1);
Thanks in advance for any assistance provided...
I don't know how to go about this and would really appreciate help on it. I
have a table with the following fields:
Territory
DateRecd
ApptDate
SaleDate
JobTotal
What I would like to do is have a query that will sum by month on the
SaleDate field, group by Territory and also count the DateRecd, ApptDate, and
SaleDate that match the summed month.
Some SaleDate records are null and it's possible some ApptDate records are
also.
Here is the SQL I have so far for summing the sales by month, I need the
help on how to get the counts of the date fields included somehow.
SELECT qryAllentown.Territory, Sum(qryAllentown.JobTotal) AS [SumOfJob
Total],
DateSerial(Year(qryAllentown![SaleDate]),Month(qryAllentown![SaleDate]),1) AS
SortMonth
FROM qryAllentown
WHERE ((Not (qryAllentown.SaleDate) Is Null))
GROUP BY qryAllentown.Territory,
DateSerial(Year(qryAllentown![SaleDate]),Month(qryAllentown![SaleDate]),1);
Thanks in advance for any assistance provided...