Hi Friends,

I'm working on employee payroll using Coldfusion and Mysql. I've to calculate the salary for the employee.
The employee took leave for 4 days 30-07-2011 to 02-08-2011.
While inserting into the DB it should slipt in to 2 records. For eg.

Empno Name From To Totaldays
---------------------------------------------------------------

4 x 30-07-2011 31-07-2011 2

4 x 01-08-2011 02-08-2011 2

Normally we insert like this

Empno Name From To Totaldays
---------------------------------------------------------------

4 x 30-07-2011 02-08-2011 4

Is it possible to split the records while inserting according to its month. Using "cfloop" or any other method please guide me.