Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you trim output in Access

Status
Not open for further replies.

jstew

MIS
Apr 12, 2002
51
0
0
US
I would like to trim a numeric field that has about 5 leading zero's. I would like the output in the report to not show those zero's. Thanks

jstew
 
check the format property for the field in the report....it probably has a number of zeros in it....take them out. If the field is bound to a table that has a format property, it automatically receives the properties of the table field...but you can change that one the repoprt and it will not change the table properties. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
I checked the format property, but their wasn't any zero's listed. The table is coming out of an accounting program.

jstew
 
Is the field in the report set to text??? That would also force the leading zeros to remain....try converting the numbers to Longs through your query....in the query, in the field where the number is displayed, in the first line, replace whatever you have there with: ConvertedNumber=DLng([name of field here]) Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Or, if the field is a fixed length, you could use a simple Right command to eliminate them.

If you're field with is 10 fixed and the first 6 are zeros,

0000007654 for example,

You could do this

NewField:Right([OldField],4)

That would trim the field down to the 4 characters on the right.

If your field is variable, then I would recommend the above suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top