Chris Travers wrote:
> Ok, the first thing to do is to try to get rid of these erroneous
> records.  This means correcting the data at the database level.
> 
> netamount should be 0 in this case.  It looks like you may need to
> update the acc_trans table to set that to 0 instead of NaN.  I.e. back
> up the data, (you may also want to select into a new table also) and:
> UPDATE acc_trans SET amount = 0 WHERE amount = 'NaN';

Database backed up and update done without issue.

> Once this is done, set up constraint in the database:
> ALTER TABLE acc_trans ADD CHECK (amount <> 'NaN');
> 
> This way  a bad invoice will cause an error instead of posting odd
> data.  This also means more immediate support calls and a better
> chance of tracking this down.

Done.

Thanks, Chris.  Much appreciated!

Charley

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ledger-smb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users

Reply via email to