Display Leading Zeros

C

Chatty Cathy

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
 
L

Larry Linson

"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
 
C

Chatty Cathy

Larry, I know I tried that in the format and it didn't work last night (maybe
I was just too tired). Well it does work now, so thank you very much.

Cathy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top