Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2005

Tip: Looking for answers? Try searching our database.

Seting format to be 000000000000000

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Beth - 31 May 2005 13:29 GMT
Hello Everyone,

I have got a field called "amount".

Currently it holds the following values 61025, 68653 etc

Is there any built in function which I can use to fill the field with
leading zeros?

Eg so it displays 00000000061025, 00000000068653.  

Ideally I want to do this in a query without any manual steps as it will be
run by end users.

Kind Regards,
Beth
Dennis - 31 May 2005 14:03 GMT
if the field is on a form and it is a text field that simply holds numbers
and the field length will always be 14 then you could put this in the after
update event of the field

YourField = Right("000000000000000" & [YourField],14)

> Hello Everyone,
>
[quoted text clipped - 12 lines]
> Kind Regards,
> Beth
Dennis - 31 May 2005 14:05 GMT
Further to my last post, because you have this in the query section, add
columns to your query to do the same job

Padded1: Right("00000000000000" & [YourField],14)

> Hello Everyone,
>
[quoted text clipped - 12 lines]
> Kind Regards,
> Beth
Jackie L - 01 Jun 2005 00:17 GMT
You can try the following in your query or on a report:

NewAmount: Format([Amount],"00000000000000")

This will only work correctly for integers.  If the field is set to double
or single then you would have to take the decimals into consideration on your
format.

Hope this helps.

> Hello Everyone,
>
[quoted text clipped - 12 lines]
> Kind Regards,
> Beth
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.