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

calculating quarterly sales

Status
Not open for further replies.

eoggb

Programmer
Feb 2, 2006
20
CA
i would like to calculate quarterly sales..so far i have this.
cStr(((datediff("q", ({Lwi_Periods.Year_Start} ),{Lwi_Periods.Year_End} )) -2),0);

but this was just an idea. I need to incoperate my date parm which selects on day and based on that day the report should select the quarter in which that date was selected from and show the entire quarter. I would like to use {Lwi_Periods.Year_Start} and {Lwi_Periods.Year_End}(dates), {Lwi_Periods.Fiscal_Day} = 1, {Lwi_Periods.Quarter}="1st Q"(string) and
if(({?Date }) = ({DailySales_Summary_vw.SalesDate})to somehow do this. Any suggestions
 
If you want three months before a parameter date, then try a formula field, say @LimitDate
Code:
DateAdd("m", -3, @ParamDate)
Try displaying this date, to check it is what you want and will work even for 31st May - Crystal tends to be clever about such dates.

Then select
Code:
{record.date} in [@LimitDate to @ParamDate]
It does depend a bit on your Crystal version, 8 or 8.5 or 9 or whatever. But the basic method should work.

If you want more quarters, do the same thing with -6 etc. Group by dates within one of the ranges.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
can't use this cause this is based on a company's fiscal year not a calander year and quarterly dates depend year by year
 
Do a set of parameters to define the 'quarters'?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top