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!

Report by Quarter or year

Status
Not open for further replies.

user35

MIS
Jun 26, 2007
29
0
0
US
Anyone have any thoughts on how to approach this? Sales manager wants a report summarizing sales by quarter and/or year. Would like to be able to do everything - run for 1 quarter or range of quarters or likewise for years or combination of years and quarters. This is all working off of database invoice field in format YYYYMMDD . Any thoughts how using parameter and Record Selection I can get him the report options he is looking for. I suppose I could break out into 2 reports (Yearly breakdown or Quarterly breakdown) if needed. Any thoughts?
 
Do a pair of suitable formula fields. Look at DatePart, DatePart ("q", {date1}) for a quarter. There are other options, including year, but yer can also be done as Year({date1}).

Once you have these values, you can then group by them and get group totals. Or you can do crosstabs, and in some versions of Crystal you get various grouping options whenever you use a date. It always helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Problem is that when I say quarter, I mean our Reporting quarter which may not correspond to 3/31 6/30 9/30, etc.. Would need to determine 'quarter' by formula
 
So are you going to tell us what your quarters are?

-LB
 
You can do a formula field that would define your own quarters, e.g.
Code:
if Month(YourDate) in [2 to 5] then "Quarter 1"
else ...
If days come into it, you can get the same result with month-and-day tests, day from DatePart ("q", {date1}).



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Since you are working with dates in a YYYYMMDD format, you also probably want to take a look at the numbertodate() function. This is a download availale here:




Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top