Results 1 to 3 of 3

Thread: Syntax Error in Crystal Report formula???

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    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?
    Blake

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    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"

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Syntax Error in Crystal Report formula???

    I didn't know that Bruce. Thanks, that worked great!!!
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width