if less then 7 digits (1 Viewer)

stu_c

Registered User.
Local time
Today, 20:03
Joined
Sep 20, 2007
Messages
489
Hi all
I have reference numbers such as 12345/89 iI want an if query to say if <7 then put leading zeros etc

eg: 123/89 changes to 00123/89 or 23/56 to 00023/56
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:03
Joined
May 7, 2009
Messages
19,229
Expr1: String(7-Len(Number),"0") & Number
 

Minty

AWF VIP
Local time
Today, 20:03
Joined
Jul 26, 2013
Messages
10,368
Is this for display purposes only?
If it is you can format the control on a form to display leading zero's.
1653659755994.png
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:03
Joined
Feb 28, 2001
Messages
27,146
Minty, would that format string work for text? Because his numbers include a virgule (/) in his examples.
 

Users who are viewing this thread

Top Bottom