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

Sales for Mutilpe Date Ranges in single report

Status
Not open for further replies.

awise

IS-IT--Management
Joined
Dec 11, 2001
Messages
85
I'm trying to design a report that will display sales by (3) separate date ranges. The ranges are not related. Range 1 could be a single day and range could could be a specified week or month, same goes for date range 3.

Item # sales for range1 sales for range2 sales range3


I setup (3) date range parameters. First question, is this the appropriate strategy to use? I want to then create (3) sales formula fields that will reference the associate date range. sales 1, sale 2 sales 3.

ex: if invoice date with [date range 1] then calculate sales for [sales 1] else 0.

Again, is this the best strategy to handle this design?

If so, can someone help me with the proper syntax to write the formula for sales 1.

Thanks in advance for your assistance and input.

Andrew
 
In your select statement you will need to restrict data

{invoiceDateField} = {?DateRangeParam1} or
{invoiceDateField} = {?DateRangeParam2} or
{invoiceDateField} = {?DateRangeParam3}

Create 3 formulae

If {invoiceDateField} = {?DateRangeParam1} then {salesField) else 0

Place these in details and and suppress detail line
Group report by Item and then add summaries of these formula to Group footer.

To show date ranges in column header

@DateRange1Start
Minimum({?DateRangeParam1})

@DateRange1End
Maximum({?DateRangeParam1})

These can be displayed in text boxes as colum headers, repeat for other Date ranges params.

Ian


 
What version of crystal?

You should never post without this info as the correct answer varies by version.

In crystal XI and newer (maybe older, I cannot test this now), create ONE date range parameter, and make sure you answer TRUE to the allow range values and allow multiple values properties.

Then create ONE formula:

if invoice date in {?YourParameter} then {@SalesAmt} else 0

{@SalesAmt} is assumed to be a calculation here. If it is just a database field, you do not need this if then formula, and you can just place the field in the report, and restrict the recordset to the date parameter field.

If

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

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top