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

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...