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

Is there a NVL formula

Status
Not open for further replies.

crystal28

Programmer
Oct 23, 2002
108
US
I have a formula in which i am concatanating 5 strings and adding a "-" in between,even if one string is empty
it wont do the concatanation,so is there a function similar to NVL that will replace a 0000 when the string is null

I dont want to validate each string with a IF that it isnt null to do this formula..
 
You do need to check per string, as in:

(
if isnull({table.field1}) then
"" else
{table.field1}
) +
(
if isnull({table.field2}) then
"" else
{table.field2}
) +

//etc.

You could also try going to file->report options->check "convert nulls to default".

-LB
 
Never heard of NVL. I would write 5 formulas like this:

If Isnull({Field1}) then "0000" else {field1}

Then one like this to concatenate them separated by a dash:

Join([{@formula1},{@formula2},{@formula3},{@formula4},{@formula5}],"-")

Note that fields 1 thru 5 must be text fields in order for this to work. if it is not change the last part of the first 5 formulas to:

totext({Field1})....

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top