Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Our organization is running an OpenSuSe 11 enviroment with MySQL,

I'm currently trying to take all the calls in our calls table and cost them using the duration multiplied by 0.00504, then from that total minus a once off "minimum call charge" of R0.50. all of this applied during weekday between the hours of 19:00 and 07:00 the following day, however i'm hitting a snag. Below is the mysql query I'm using:

UPDATE Calltable SET callcost = ((duration * 0.00504) - 0.50) WHERE WEEKDAY(Date) IN (0,1,2,3,4) AND Time < "07:00:00" OR Time > "18:59:59" AND Tariff = "customtariff" AND duration > 100

Below is the error i receive:

0 row(s) affected, 65535 warning(s)

Execution Time : 00:00:16:630 Transfer Time : 00:00:00:000 Total Time : 00:00:16:630

Note Code : 1265 Data truncated for column 'callcost' at row 4

Note Code : 1265 Data truncated for column 'callcost' at row 6

Note Code : 1265 Data truncated for column 'callcost' at row 8

Note Code : 1265 Data truncated for column 'callcost' at row 10

Please help :\

share|improve this question
    
Please run SHOW CREATE TABLE Calltable\G and post just the callcost column so we can know the datatype. –  RolandoMySQLDBA Jun 6 '13 at 16:40
1  
Ah, found it to be that we had set the cost column length as "9,2" problem with that was that due to the per second we now had Cents stretching beyond two decimal places, hence the warning. –  Richard Jun 6 '13 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.