Display Leading Zeros

  • Follow


Hi.  I have a field that I have defined as numeric, integer.  On my report, I 
want it to print high order zeros.  (For example, if the field contains 155, 
I want four characters to print 0155).  I've tried using function str to 
convert it but no luck.  I tried using a format and that didn't work.  Thanks
0
Reply Utf 9/8/2007 4:56:01 AM

"Chatty Cathy"  wrote

 > Hi.  I have a field that I have defined as numeric,
 > integer.  On my report, I want it to print high order
 > zeros.  (For example, if the field contains 155,
 > I want four characters to print 0155).  I've tried
 > using function str to convert it but no luck.  I
 > tried using a format and that didn't work.

Using the format "0000" in the Format Property of the Control in which you 
display the number should display four digits of your number (that will also 
be the case, BTW, if the number is greater than 9999, which an integer might 
be), if the number is always positive.  it doesn't help us much to know that 
you "tried using a format and that didn't work" because your didn't tell us 
_what_ format you tried that didn't work -- and, as you might expect, there 
are many formats that will not display four digits including lead zeros, and 
no more.

  Larry Linson
  Microsoft Access MVP 


0
Reply Larry 9/8/2007 5:28:02 AM


1 Replies
410 Views

(page loaded in 0.069 seconds)


Reply: