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!

How to specify multiple start dates across several groups

Status
Not open for further replies.

Solojer

Technical User
Feb 28, 2008
54
CA
Hi there! I have a report that I am working on that has multiple groups. Each group has a different sales rollover date, and the "from date" needs to be different per group. How would I go about doing this in one report?

Example:
Car [tab][tab] Rollover Date
====[tab][tab]===============
Ford [tab][tab]May 15, 2012
Mazda[tab][tab]May 10, 2012
GM [tab][tab]April 12, 2012

I'm trying to find a way for one report to show all sales from May 15, 2012 and beyond for Ford, but all sales from May 10th and beyond for Mazda. Note that there are sales before both those start dates for each model, in this scenario.

Thanks!
 
You could define a formula, e.g.
Code:
if "Ford" then Date(2012, 5, 10)
else ...

It helps to give your Crystal version - 8, 8.5, 9, 10, 11, 2008 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
In select statement

CarMakeField in ['Ford', 'Mazda', 'GM'] and
(If CarMakeField = 'Ford' then datefield >= date(2012, 5, 15) else
If CarMakeField = 'Mazda' then datefield >= date(2012, 5, 10) else
datefield >= date(2012, 4, 12))

The IF statement will not be parsed to database so if you have more than the 3 makes of car you need to reduce dataset as much as possible.

Ian
 
Thanks for the suggestion -- I'm currently using Crystal 10.

What if the Car make and rollover date are both dynamic? {table.car_make} and {table.rollover_date}, for example?
 
what do you mean by dynamic.

Are the rollover dates held in database?

Ian
 
Yes, rollover dates and car make are held in the database.
 
Bump.. Can anyone let me know if this is something that is possible? Thanks!
 
You should be able to link to the table with the rollover dates, probably by make,
then you can use {table.rolloverdate} in your select formula.
 
You just need to use a select formula like this:

{table.salesdate} >= {table.rolloverdate}

Then group on the car field, and you'll see that the dates are appropriate per make.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top