Hi Bruce,
If I tried to put an If ..Then .. Else in the middle of a selection formula I
would expect CR to fall flat on its face. Deal with these separately. For
example, you could use the following in Selection Formula:
BooleanVar SelectClient;
If ?client = "ALL" Then
SelectClient := True
Else
SelectClient := (client_name = ?client);
IsNull(Date_Paid) AND
SelectClient AND
IsNull(Date_of_Death) AND
Date_of_Birth IN {?DateRangeStart} TO {?DateRangeEnd}
Regards,
John................
Quote:
> Hi All,
> I've been finding as my select criteria get more complex Crystal is having
> trouble. For example, if I want to select clients who have not paid and use
> a select statement "IsNull(Date_Paid)", and I also have several other select
> criteria, Crystal sometimes returns an empty set - but if I make this the
> first select statement Crystal seems to do OK. Now if I add a couple of
> other complex select statements; for example the client list is large and
> sometimes the report is run for individuals but sometimes the report is run
> for all clients, I add "ALL" to the parameter default list and create a
> select criteria statement "If ?client = "ALL" then client_name <> "" else
> client_name = ?client". Now I might only want to look at clients still
> alive so I add IsNull(Date_of_Death), and I only want to report on clients
> of a specific age group so I add parameters for birthdate. My final select
> criteria statement might be:
> IsNull(Date_Paid) AND
> If ?client = "ALL" then client_name <> "" else client_name = ?client AND
> IsNull(Date_of_Death) AND
> Date_of_Birth IN {?DateRangeStart} TO {?DateRangeEnd}
> I've had Crystal fall on it's face with this type of select criteria. Often
> by re-arranging the order of the statements I can get the report to produce
> data but I never feel confident it will work all the time.
> Has anyone else experienced this problem, and is there a way I can make a
> report of this type more reliable?
> Thanks in advance for any info,
> Bruce