I'd make the following recommendations:
- Put your csv files in your database. It's an extra table, but your data will become so much more usable and valuable.
- Create a "transaction register" table to reconcile the payments. The contents of your csv files would be entered into this table with positive amounts, and the data from ADP would be entered with negative amounts. Then you can use SQL to tell you if everything adds up.
The structure of the transaction register table would look something like this:
CREATE TABLE txn (txn_id INT PRIMARY KEY AUTO_INCREMENT, account VARCH
+AR(64), amount INT);
ALTER TABLE txn ADD INDEX i1 (account);
Then the contents of the first
csv file would be entered with statements like the following:
INSERT INTO txn VALUES (NULL, '101', 40167);
INSERT INTO txn VALUES (NULL, '101', 30821);
...
and the contents of the second
csv file would be entered as:
INSERT INTO txn VALUES (NULL, '101', -131386);
To determine which accounts are not reconciled, perform the following query:
SELECT account, SUM(amount) as total FROM txn GROUP BY account HAVING
+total <> 0;
and this will list the accounts and the amounts by which they are off.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.