Wednesday 19 August 2015

Add leading zeros in access

There are tow types of leading zeros-

1. Test type fields with numeric values-
     
            select Format(fieldname, '000000000000')as [WithZeros],  * from TableName


2. Test type fields with text values

      select  String(9-Len([fieldname]),"0")&[WithZeros] as [ttt],  * from TableName

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...