Re: how to format a decimal number...
I don't think formatting will help you here. If the result cannot be represented with the precision of the column you're trying to change then your only solution is to modify the column definition. If you're sure that the result will fit into the column you can try this:
Originally posted by angelitoz
Hi... i am a desperate newbie... i am trying to insert into a table some decimal values... but....
INSERT INTO TT set xx = (yyy/zzzz)
the field xx has decimal places but the division result has more decimals than it... so i need to format it in the sql, i must do it in the sql statement..
is there any format number function?
INSERT ... SET xx = DECIMAL(yyy/zzzz, p, s)
where q and s are the precision and the scale of your target column, respecitvely.
"It does not work" is not a valid problem statement.