I'm looking to find records that are in 1 date range but not in another. Is there a way to do this using Crystal. I can do this using a SQL statement but am having trouble inside of Crystal. I would like to use date range parameter vales with this.
You could do a pair of boolians, each formula something like
Code:
{MUCH.CeaseDate} in [Date(2007,1,1) to Date(2007, 12, 31)]
Then use the name, or the name preceded by not, this will work OK.
It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.
Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10
Sorry, I'm using Crystal 9. I've tried a select statement like this: adbase.customer in {?Range 1} and adbase.customer not in {?Range 2}.
The big thing is I need to use parameter vales for the dates. I would also like to use date ranges so it's easier for the sales staff to run the report.
Here is an example. I work for a newspaper and I'm trying to find customers that placed an ad with us in Jan. 2006 but have not placed an ad with us in Jan. 2007.
Then insert a group on customer and create a formula {@inRange2}:
if {table.date} in {?Range2} then 1
Then go to report->selection formula->GROUP and enter:
sum({@inRange2},{table.customer}) = 0
If you need to summarize across customers, you will need to use running totals as the more usual inserted summaries would include the non-group selected records.
I guess I will have to read up on using commands. I have never used one. I did get it to work using lbass's suggestion but may try using a command.
Thanks
In our organization where we have about 2000 reports most of the report writers have converted over to using Commands since it is easier to optimize with control over the SQL and to prebuild the data for ease of reporting. We make extensive use of Oracle's Analytical Functions to push all the aggregations down to the Oracle server which makes for efficient reporting and even doing things that were impossible with Crystal generated SQL.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.