I am using the following query to extract certain records in a table based on a text field:
SELECT tblCategoryBayCode.MasterNo, tblCategoryBayCode.BayCode, IIf(Left([Baycode],2)<10,"0"+[Baycode],"") AS Expr1
FROM tblCategoryBayCode;
The sample data is something like as under:
MasterNo BayCode Expr1
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
I am tryuing to add a zero in the front of middle column when the first letters are less than 10.
Problem is when it matches the criteria, it gives me #error value and rest are blank. Is there something I can do to modify the contents.
Cheers
AK
Note: Using Access 97 for back end A2002 for front end.
SELECT tblCategoryBayCode.MasterNo, tblCategoryBayCode.BayCode, IIf(Left([Baycode],2)<10,"0"+[Baycode],"") AS Expr1
FROM tblCategoryBayCode;
The sample data is something like as under:
MasterNo BayCode Expr1
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
31 1A #Error
I am tryuing to add a zero in the front of middle column when the first letters are less than 10.
Problem is when it matches the criteria, it gives me #error value and rest are blank. Is there something I can do to modify the contents.
Cheers
AK
Note: Using Access 97 for back end A2002 for front end.