Forum Moderators: coopster
ALTER TABLE `BMG` CHANGE `I_PLQ` `I_PLQ` DECIMAL( 10, 2 ) DEFAULT '0'
but i need it to also round the existing values up. for example: 2.4875 to 2.49
but for some reason it rounded it to 2.48, and i don't know how to change the statement so it will round values up for existing values in the field. is this even possible? if not, how would you handle it? please advise,
TIA,
makimoto
i added a new field using phpmyadmin and gave it the same attributes as the field i was copying from (so i cheated a bit here).
then i used two UPDATE statements to get me where i wanted to be (i probrably could have used one, but i can't think of how). the first one was:
UPDATE table
SET field_2=field_1;
and the second one was:
UPDATE table
SET field_2 = ROUND( field_2, 2 );
this suceeded in creating a new field_2, copying the values from field_1 to field_2, and then rounding the values in field_2 up two decimal places. so in the end, i did not even have to change the type of field from "float" to "decimal(10,2)". for example, now 2.4875 = 2.49 NOT 2.48.