Print Page | Close Window

Multiple selection conditions- order

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15687
Printed Date: 18 May 2024 at 11:31pm


Topic: Multiple selection conditions- order
Posted By: Just
Subject: Multiple selection conditions- order
Date Posted: 22 Feb 2012 at 12:20am
I have a report with 4 tables (Category, SRZ,TraNag, VatNag, in Database expert, last 3 are connected with full outher join with Categoryid. The report is grouped by categoryid. SRZ,TraNag, VatNag are bound by date in select expert ( date in range). If there is a document in that range it shows category id and another field from one or all 3 remainging tables. I would like the report to show all records that give answer in the given date range. So far First date range in TraNag is checked and then if it is true the following two date ranges are checked.
If I add a new Category id and a docuemt e.g. in SRZ it does not show me the record even though the date range condition is true.

Is there a way to have conditions in the select expert written so that no matter which table has a racord in the given date range  it shows the record from table /s . Not only if TraNag has the condition evaluated as true.

Hope that without select expert conditions somebody can give me the answer.If no I can provide those



Replies:
Posted By: rkrowland
Date Posted: 22 Feb 2012 at 1:03am
Create a formula as follows;
 
@Select:
if (
 ({tranag.datefield} >= STARTDATE and {tranag.datefield} <= ENDDATE)
or
 ({srz.datefield} >= STARTDATE and {srz.datefield} <= ENDDATE)
or
 ({vatnag.datefield} >= STARTDATE and {vatnag.datefield} <= ENDDATE)
)
then
TRUE
else
FALSE
 
Then perform your record selection on this formula, ie;
 
mailto:%7b@Select - {@Select } equal to TRUE
 
Regards,
Ryan.
 


Posted By: Just
Date Posted: 22 Feb 2012 at 2:12am
Does it matter in which order I put them? Stil if I add new cathegory ID it stops checking on first condition being true.


Posted By: DBlank
Date Posted: 22 Feb 2012 at 3:37am

likely the issue is that you are evaluating Nulls.

If your formula option or report options are not set to handle nulls then the formula will stop evaluating when it hits the null (which acts the same as a false in the select expert).
if you are using Ryan's suggestion and you have a formual field with to return a T/F on the 3 date ranges change that formula field to use  the option of 'use default values for nulls' and palce it on your report canvas to see if you get TRUE and FLASE on each row as you wanted it to.
 
your statement would be similar to Ryans suggestion.



Print Page | Close Window