Print Page | Close Window

Selecting records by either ID number or surname.

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10705
Printed Date: 29 Apr 2024 at 2:24am


Topic: Selecting records by either ID number or surname.
Posted By: ceboww
Subject: Selecting records by either ID number or surname.
Date Posted: 01 Aug 2010 at 10:57pm
I am trying to make my report so that when the user opens it they are prompted for both the ID number and surname, but are told to only enter one. The formula for the select expert should then be able to check which value is null and then filter records by the parameter that isnt. Before now I have only programmed in java but I gave it a go and this is what I have so far.

if ({clientmaster.SURNAME} = "") then
{clientmaster.ID} = {?Client ID}
else if isnull({clientmaster.ID}) = true
then {clientmaster.SURNAME} = {?SURNAME}


Any help you can give would be appreciated, thank you.



Replies:
Posted By: DBlank
Date Posted: 02 Aug 2010 at 3:32am
Not sure what version you are using or what interface for deploying but in most cases you cannot leave parameters blank therefore you will need to account users to enter something in both.
From there you should avoid using if-then in a select statement and just do one OR statement
Param1=id
or
param2=name



Print Page | Close Window