Sum by Date field

P

PHisaw

I have a table with fields InvDate, Inv, Sales, Cost for years 2006, 2007 and
2008.
First query lists all fields plus calculation of GP: Sales+Cost.
Second query groups each field except GP which is a Sum ([SumGP]).
Report has textbox calculation for 2006 column and repeats for other two
years - 2006GP (label) =Sum(Abs([InvDate] Between #1/1/2006# And
#12/31/2006#)*[SumofGP]).
Thanks to Duane Hookom this works very well.
Now boss wants to rank 2006GP by descending amounts.
I know I can't sort the report by a calculation on the report.
When I try to use ths same calculation =Sum(Abs([InvDate] Between #1/1/2006#
And #12/31/2006#)*[SumofGP]) in a query I get a message "You tried to execute
a query that does not include the specified expression [SumofGP] as part of
an aggregrate function." I've tried several other calculations and nothing
seems to work.

If anyone has a solution to sort this report based on information above, it
will be greatly appreciated.

Thanks in advance,
Phisaw
 

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