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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using null as a parameter in a select expert range 2

Status
Not open for further replies.

marabou

IS-IT--Management
Jan 12, 2001
86
GB
I have a problem with parameter fields and select expert.

I want users to be able to select a customer's account number to report on, either by range or discrete value. I would also like to do a range (I am using CR 8) and this is OK but it is only returning the customers who have account numbers, which they sometimes don't. How can I let them select ranges which also include those customers which don't have account numbers?

Would be grateful if anyone could give me some help on this.

Thanks in advance
 
you have to add a line to the formula that says:

IsNull({accountno}) or
.....


This has to be first, because if it reads a null value without the IsNull it stops reading and skips the record. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Sorry, it doesn't work, somebody had been messing with my test data.

I have got the field to display "No Acc. No." when there is no account number but in the record selection Crystal syntax I have included this and it still doesn't work.

"IsNull ({@Sage Account}) or
{@Sage Account} = {?Sage Account 2}"

Where the "@Sage Account" formula is

"If IsNull ({CUSTOMERS.SAGEACCOUNT}) Then "No
Sage Account" Else {CUSTOMERS.SAGEACCOUNT}"

and the "Sage Account 2" parameter is selecting the field from the database which holds Account Numbers.

It still only selects those records within the range which have account numbers.

Any ideas, I would appreciate any help anyone could give.

Thanks in advance

 
{@Sage Account} will produce one of two possible outputs:
"No Sage Account" when the SAGEACCOUNT is null;
{CUSTOMERS.SAGEACCOUNT} when the SAGEACCOUNT is not null.
The output of this formula is never null.

Your formula in the record selection formula
IsNull ({@Sage Account}) or
{@Sage Account} = {?Sage Account 2}
The first line always evaluates to false, because your formula {@Sage Account} is never null. I'm not sure what you are doing with the second line.

Changing the first line of the selection formula to
IsNull({CUSTOMERS.SAGEACCOUNT}) or
would be a good first step. I suspect the second line should look like
{CUSTOMERS.SAGEACCOUNT} = {?Sage Account 2} Malcolm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top