June 15th, 2012, 06:52 AM
Join Date: May 2002
Time spent in forums: 1 Day 23 h 54 m 22 sec
Reputation Power: 12
Insert and split currency in sub select
I wish to insert into a table using select, but I need to split a currency amount between the number of inserts for the select and where there is a balance leftover this needs to be justified to one of the inserts.
i.e divide 100 between 3 inserts
I currently do the following using PHP but it does not take care of the pennies.
tenants WHERE tenancy_id = 100 AND tt_rent_split > 0 AND tt_deleted = 0;