P
Patrick
I know many people ask this but I still am having trouble understanding
how I can do what I need to do. Basically, it comes down to the idea
of grouping by one field and sorting by another.
I have tblClients and tblCommissions. There is a one-to-many
relationship between tblClients.intClientID and
tblCommissions.intClientID. I have two basic fields that I want to
have shown on the report, tblClients.strName and a sum of
tblCommissions.curAmount. I need to be able to specify a date range
for this report also (tblCommissions.datPeriod).
So, I have a query that pulls the desired information. Fields selected
are tblClient.strName (Group By), curAmount (Sum), and datPeriod (Group
By).
The results returned are what I would expect. Here's an example of the
results:
intClientID strName SumOfcurAmount datPeriod
33 Test Client A $1,478.98 09-01-2005
35 Test Client C $1,250.00 11-01-2005
35 Test Client C $892.15 08-01-2005
34 Test Client B $766.43 08-01-2005
33 Test Client A $476.82 08-01-2005
However, when I put this query as the record source of a report I can
not get the results I need. I can either have the report
grouped/sorted by strName or grouped/sorted by SumOfcurAmount. What I
really need is it to be grouped by strName and then sorted by
SumOfcurAmount so that we can see the total commissions for each client
(sorted by SumOfcurAmount DESC) based on a specified range (which I
will do with a Form).
Can anyone explain how I can do this?
how I can do what I need to do. Basically, it comes down to the idea
of grouping by one field and sorting by another.
I have tblClients and tblCommissions. There is a one-to-many
relationship between tblClients.intClientID and
tblCommissions.intClientID. I have two basic fields that I want to
have shown on the report, tblClients.strName and a sum of
tblCommissions.curAmount. I need to be able to specify a date range
for this report also (tblCommissions.datPeriod).
So, I have a query that pulls the desired information. Fields selected
are tblClient.strName (Group By), curAmount (Sum), and datPeriod (Group
By).
The results returned are what I would expect. Here's an example of the
results:
intClientID strName SumOfcurAmount datPeriod
33 Test Client A $1,478.98 09-01-2005
35 Test Client C $1,250.00 11-01-2005
35 Test Client C $892.15 08-01-2005
34 Test Client B $766.43 08-01-2005
33 Test Client A $476.82 08-01-2005
However, when I put this query as the record source of a report I can
not get the results I need. I can either have the report
grouped/sorted by strName or grouped/sorted by SumOfcurAmount. What I
really need is it to be grouped by strName and then sorted by
SumOfcurAmount so that we can see the total commissions for each client
(sorted by SumOfcurAmount DESC) based on a specified range (which I
will do with a Form).
Can anyone explain how I can do this?