in reply to Re^2: payroll, mysql and perl question
in thread payroll, mysql and perl question

... the amount does matter, because it could be that they have other checks 'preissued' by the time we get the file from adp, that has the check numbers.

In other words, between the time that a set of rows goes out for check processing, and the time when the check-processing results come back to you for updating the table, there might be additional "preissue" rows that have been inserted for a given "empID". Is that it?

In that case, you are missing a piece of information, which might be simple to add in the current table structure: the date when a given set of rows were sent out for check processing (i.e. when the status field was set to "preissue"). You appear to have a "statuschanged" field, which apparently holds a date value.

If that field is set when the status field becomes "preissue", and if a set of check-processing results can be associated with that date, then you can select "preissue" rows with "statuschanged" less-than-or-equal-to the particular date, and you should get the right set of rows (excluding the rows that were added after the current list of payments were sent out for processing).

Your alternative of looping over records until you reach the payment amount would most likely solve it as well, but seems like more work. (And you would have to fix the spelling: "ORDER BY" -- no final "E")

Replies are listed 'Best First'.
Re^4: payroll, mysql and perl question
by powerhouse (Friar) on Jan 02, 2008 at 23:30 UTC
    lol, yeah, no bye ;o)... I have slept now, but had not slept in a long time when I did that. surprised I did not make more mistaks than that.

    Anyhow, yes you have the correct, and yes statuschanged is a unix timestamp(epoch), so yes I could use those to do this. However, we make two pay runs in each cycle. So there could be two different timestamps.

    Thank you much for your input, I really appreciate it.

    thx,
    Richard