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

Year to Date Sales

Status
Not open for further replies.

KBChristy

IS-IT--Management
Sep 3, 2002
32
GB
How do I create a formula to give me year to date sales from the start of our financial year to the end date specified in the parameters. In other words, I want to show current month sales (based on 2 parameter dates - done this!) and year to date sales?
 
For year to date, if your year starts jan 1, use the following:

If {Datefield} in YearToDate then {SalesAmount} else 0

For month to date, use the same formula with the MonthToDate function in place of the YearToDate function.

If the year does not start on Jan 1, create one parameter (not two) and make it a date-range parameter. Then your formula is:

If {Datafield} in {?DateRangeParameter} then {SalesAmount} else 0

Let me know if you have any questions. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Create running totals selecting the field you want and SUM as the Type, and place something like:

// For Month to Date
{MyTable.MyDateField} in MonthToDate

If you had shared your financial dates, I would have given you an exact formula for that.

It's basically the same thing, but you need to determine the starting date, check out the datediff and dateadd functions.

You can cheat the start date with something like:

// Assumes a 6/1 start of year
if currentdate < date(year(currentdate),6,1) then
dateadd(&quot;YYYY&quot;,-1, date(year(currentdate),month(currentdate),1) )
else
date(year(currentdate),6,1)

Something like that...

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

Part and Inventory Search

Sponsor

Back
Top