Adding two numbers
HI folks
I think I have asked this question before. I am trying to multiply a quantity field by a cost field to give a total cost. The fields are text as you can only have an integer arithmetic value (and cost and total cost will be a $$.cc format)
Has anyone done something similar. what might the SQL look like?
2 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
JordanNolan
4 years ago
update HD_TICKET
Set HD_TICKET.CUSTOM_FIELD_VALUE21 =
(
( CONVERT(CUSTOM_FIELD_VALUE16, decimal(10,2)) * CONVERT(CUSTOM_FIELD_VALUE17, decimal(10,2)))
+ ( CONVERT(CUSTOM_FIELD_VALUE19, decimal(10,2)) * CONVERT(CUSTOM_FIELD_VALUE20, decimal(10,2)))
)
where
HD_TICKET.ID in (<TICKET_IDS>) - kiwiblue 4 years ago