Discussion Locked

Access- Show Leading Zero

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do I get an Access table to store and display a leading zero in a number field?

6 replies

by kpennington

I don't think you can store a numerical value with a leading zero, but when you retrieve the value via a query you can build an expression such as
Expr1: IIf([Your Table]![Your Field]<10,"0" & [Your Table]![Your Field[Your Table]![Your Field])

by calson

Set the format to 000000
this would show a number such as 123 as 000123 or 12345 as 012345

Or else set it to \00 which will put a 0 before every number. e.g. 123 ~ 0123, 12345 ~ 012345

And, if you want to store a number which could be any length with any number of 0's before it, then store it as text.

by miss kitty

Calson,
Your answer was perfect. It took care of a problem I was having with exporting a numeric/double. It now is right justified like it should be. Sorry to horn in on your question, but this really solved a big problem I was having.

Cathy

This discussion is closed to new replies.