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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for a date range so I can do an average 1

Status
Not open for further replies.

Kallen

MIS
Aug 14, 2001
80
US
I am going nuts trying to figure this out and I am hoping someone here can help me.

I am using Crytal 8 and am trying to make a report that shows balances in months. I have two years worth of data but I only want to base the average on this year.

What I want to do is make a formulas that would be something like this.

If {File Date} is Between 1/1/2004 and 12/31/2004 then
Sum{LedgerBalance}

else

0

What I am trying to tell Crystal to do is to only calculate the balances for 2004 and disregard that data that is in 2003. What I can do with this formula is make a pivot table and have my summary be an average (which I think would be simpler than creating another forumla.

I have been looking around in Crystal formulas and see so many date functions I am even more confused then when I first started. I did a search on this forum and saw similar requests but I am still really confused.

Any help would be greatly appreciated. Also, please let me know if I need to provide more info. I am still new to formulas so pardon my syntex, I just wanted you all to get an idea of what I am thinking.

Thanks!!
 
Use a Running Total (Insert->Field Object->Right click Running Totals and Select New).

In the evaluate use a formula place something like:

year({table.field}) = year(currentdate)

Set the Type of Summary to Average.

-k
 
Thanks! I had never done anything with running totals before and there is a lot of great stuff in there!

I used the formula and it looks as though it will work like a charm.

Have a great weekend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top