Issue Casting as either decimal or integer

  • i am trying to multiply the duty rate (a decimal) by the Total Value, which can be decimal.

    CAST (D.Duty_Rate as decimal(22,8) * Sum(M.TOT_EXT_COST) as Duty_per_Part

    As written, i get the an error ...... Incorrect syntax near '*'.

    Do i need to Cast the second part of the formula?

    Thanks

  • You're missing a close bracket.

    Should be
    CAST (D.Duty_Rate as decimal(22,8))

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • That sir, is why your'e a GURU . . . . 🙂

    Thanks . . . .Much appreciated.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply