PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
SELECT costumers.id as cID,sum(users_payment .total_bill-actuall_payed)
from costumers
LEFT JOIN users_payment ON users_payment.userid=costumers.id AND users_payment.month<5
group by cID
LIMIT 0, 50
in the first result i get instead of 92 i get : 91.199996948242
what can i do to prevent this? and get the correct answer?
by the way in the first line i am adding 2 number : 45.5 and 46.5=92
so whats the solution
tnaks in advance
peleg
Well, you could use abs(sum(users_payment.total_bill-actuall_payed)) or similiar if you need to strip of the decimals, but there is also CEIL() and FLOOR() depending on preference (discounts, goodwill aso aso).
Browse the math functions that mysql uses and you might find something that fits you better.