Topic: Account Code to be define as int
In chart_master table if I change the data type of account_code field from Varchar to int, will it cause any anomaly in relationships with other tables?
I have kept all Account Codes as Integer
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Banking and General Ledger → Account Code to be define as int
In chart_master table if I change the data type of account_code field from Varchar to int, will it cause any anomaly in relationships with other tables?
I have kept all Account Codes as Integer
Hello @boxygen
Yes it will. There are many tables where there are references to the account number, so please do not change this. Why do you want to change from varchar to int. The reason for using varchar is how the account numbers are sorted and there might be a wish in some countries to have them alphanumeric.
In most serious accounting systems this variable is varchar.
Joe
Thanks @Joe,
Yes I understand, but Actually I needed a customization to automatically pick the Next Available Account Code for the Given Account Type. It worked Fine till Code 2899 but when it reaches 28100 it is not picking the next value 28101 because the order sequence of Varchar says 28100 is smaller than 2899.
Converting it to INT is working fine but I fear it may cause anomalies. Any Ideas?
May not solve your problem as used for ordering, but could help:-
stack-overflow mysql order varchar field as integer not sure how you could use this to select next, but maybe you can?
More here @ DBA SE pad the front with zeros or use CAST
Another one here uses a different method to sort by length 1st... the article also mentions a php function natsort() which may be worth investigating
FrontAccounting forum → Banking and General Ledger → Account Code to be define as int
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.