SQl Insert code issue -
i'm trying write 2 sql queries write data. 1 insert , 1 update. need round dollar amount 2 decimal positions. can syntax on both queries - don't know how cast differs between insert , update. here have far:
the insert:
if not exists (select 1 ordershippingbox ordersplitid={0:ordernumber} , trackingnumber={0:pin}) insert ordershippingbox (ordersplitid, aboxnumber, trackingnumber, boxweight, boxl, boxw, boxh,shippingcharge) values ({0:ordernumber},{0:packagenumber}, {0:pin}, {0:weight}, {0:diml},{0:dimw},{0:dimh},{0:estimatedrate})
the update:
update ordershippingbox set shippingcharge=cast({0:estimatedrate} decimal(12,2), ordersplitid={0:ordernumber}
in both cases estimatedrate needs round 2 decimal positions. think have update correct, can confirm? need insert.
Comments
Post a Comment