05-21-2014, 09:10 AM
joebordes Wrote:Yes, there is an error in the update:
Code:
substr(`account_no`,0,3)
instead of
Code:
substr(`account_no`,1,3)
Now you are going to have to play around with the substring/lpad to get it right (sorry)
I guess it will be something down the line
Code:
UPDATE `vtiger_account` SET `account_no`= concat('ORG',lpad(substr(`account_no`,4),5,'0')) where substr(`account_no`,1,4)=='000G';
that will fix the first 9, then you need another one for the next 90
Code:
UPDATE `vtiger_account` SET `account_no`= concat('ORG',lpad(substr(`account_no`,3),5,'0')) where substr(`account_no`,1,3)=='00G';
PLEASE test the assignment before launching
I guess I will have to delete and re-import the whole database. There are 1650 records and those queries did not work either. Thank you anyways.