0

Anybody know why I can use addition (columnA + columnb) as columnc in Marketing Cloud SQL, but seemingly not multiplication (as below)? Or am I doing something wrong in this code?:

SELECT SubscriberKey,
Product,
Purchases,
Timestamp,
Product_Value,
(Purchases * Product_Value) as Purchases_Value
From Claimed_Purchases_With_Values

The resulting query runs, but nothing appears in Purchases_Value.

3
  • can you check if the resulting size of the multiplicated value is within the bounds of your attribute size in which you want to store it Commented Jun 14, 2017 at 11:02
  • What's the datatype of the column in the target data extension? Commented Jun 14, 2017 at 11:51
  • Yeah, it turns out I was trying to multiply a decimal with a number field. I fixed it by changing both to decimal. Have posted it as an answer in case anyone else comes across this. Commented Jun 16, 2017 at 10:56

1 Answer 1

1

Thanks for the comments, which I think were heading for the solution I eventually found.

The data types need to be the same - you can't multiply a number by a decimal or vice versa. Once I changed both to decimal, it worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .