Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 totals for different date range

Status
Not open for further replies.

kuo

Programmer
Nov 7, 2002
14
US
Hi.

I have a table with sales, post_date, I like to calculate total sales for 1/2002 through 10/2002 and prior year 1/2001 through 10/2001. how to do it ?


thanks so much for the help
 
Add something like this to the record selection criteria:

(
{MyTable.MyDate >= date(2002,1,1)
and
{MyTable.MyDate < date(2002,11,1)
)
or
(
{MyTable.MyDate >= date(2001,1,1)
and
{MyTable.MyDate < date(2001,11,1)
)


You can create a formula field to group on:

If {MyTable.MyDate >= date(2002,1,1)
and
{MyTable.MyDate < date(2002,11,1)
then
'1/2002 through 10/2002'
else
'1/2001 through 10/2001'

Now the first group of data will be the 2001 set, the next will be the 2002.

You can now use conventional right click insert summary operations on the fields.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top