Syntax Error in Crystal Report formula???
I'm using CR 10. I have a formula that keeps giving me the following error:
"The remaining text does not appear to be part of the formula"
The error occurs beginning and ending with the highlighted code.
Here is my code:
Code:
if {tblBatchDetail.carrierSCAC} > "" then
if {tblBatchDetail.fein} > "" then
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein};
if {tblCarriers.AdventCarrierCD} > "" then
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein} & "/" & {tblCarriers.AdventCarrierCD}
else
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein} & "/(Unk)"
else
{tblBatchDetail.carrierSCAC} & "/(Unk)"
else
"Unkown"
end if
What exactly am I missing here....a colon, semi-colon after each statement?
Re: Syntax Error in Crystal Report formula???
Use parentheses when you want to run multiple statements within an If branch. There is no End If when using Crystal Syntax.
Code:
if {tblBatchDetail.carrierSCAC} > "" then
if {tblBatchDetail.fein} > "" then
(
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein};
if {tblCarriers.AdventCarrierCD} > "" then
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein} & "/" & {tblCarriers.AdventCarrierCD}
else
{tblBatchDetail.carrierSCAC} & "/" & {tblBatchDetail.fein} & "/(Unk)"
)
else
{tblBatchDetail.carrierSCAC} & "/(Unk)"
else
"Unkown"
Re: Syntax Error in Crystal Report formula???
I didn't know that Bruce. Thanks, that worked great!!!