Adding zreos (1 Viewer)

Hecronis

Registered User.
Local time
Today, 04:36
Joined
Apr 26, 2016
Messages
60
I have a report that I have to run that is supposed to show a list of 4 digit codes. However if the code happens to start with zeros it will not display them. Example if the code is "0062" it will only show as "62" but I need it to show all 4. I've tried to use input masks but other than that I really wouldn't know how to show preceding zeros. Any suggestions?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 19:36
Joined
Jan 20, 2009
Messages
12,851
Either store the codes as text or use the Format function to convert the number in the ControlSource of the text box.

Code:
=Format(fieldname, "0000")
 

Hecronis

Registered User.
Local time
Today, 04:36
Joined
Apr 26, 2016
Messages
60
The format code worked perfect. Thank you.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:36
Joined
Sep 12, 2006
Messages
15,638
if the leading zeroes are significant, I would store them as text, not as a number format.

Otherwise there is no way to have both "062" and "0062" (if the underlying data is just Integer 62)

Using text gives you the added benefit of being able to use Alpha characters if needed, and may be helpful with sorting.
 

Users who are viewing this thread

Top Bottom