General discussion

Locked

Access- Show Leading Zero

By munrrob ·
How do I get an Access table to store and display a leading zero in a number field?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by kpennington In reply to Access- Show Leading Zero

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])

Collapse -

by munrrob In reply to

Poster rated this answer.

Collapse -

by Calson In reply to Access- Show Leading Zero

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.

Collapse -

by munrrob In reply to

Spot on, thanks for the advice.

Collapse -

by Miss Kitty In reply to Access- Show Leading Zero

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

Collapse -

by munrrob In reply to Access- Show Leading Zero

This question was closed by the author

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Software Forums