Losing leading zeros (1 Viewer)

simongallop

Registered User.
Local time
Today, 13:52
Joined
Oct 17, 2000
Messages
611
Have a report showing trunk lines which are 9 / 10 characters long starting with a zero ie 001002015

Have set the row source for the graph as text, set the graph as text set the axis format as text. It looks correct in design mode. Open it in preview it loses the zeros and shows 1002015

HELP PLEASE!!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:52
Joined
Feb 19, 2002
Messages
43,668
You can use the Format() function to display a fixed length numeric field with leading zeros.

Format(YourField,"0000000000")

If the field is variable in length, you need some way to identify what the length should be.

IIf(SomeCode, Format(YourField,"000000000"), Format(YourField,"0000000000")
 

simongallop

Registered User.
Local time
Today, 13:52
Joined
Oct 17, 2000
Messages
611
Did that in the query, yet the axis was still adamant that it wanted to lose the zeros!! The only way around it was to change the format on the axis to custom and 000000000. Problem for the larger trunks, but have split the report and created a duplicate template to show the 10digit trunks. The other way that I looked at solving it was to insert a single quote which worked but it looked slightly weird!!

Thanks
 
A

AnalystDBA

Guest
Harry,

Try this.

Open the report in design view and double click the chart to open it in MS Graph.

In MS Grapg right click the graph and select Chart Options

In the Chart Options tab select the Axes Tab and change the primary axes from Automatic to Category.

Cheers.

AnalystDBA
 

simongallop

Registered User.
Local time
Today, 13:52
Joined
Oct 17, 2000
Messages
611
Nope that doesn't work. Will have to stick to format 000000000
 

Users who are viewing this thread

Top Bottom