Results 1 to 3 of 3
  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    ADD "0" TO the number

    Hello everybody,
    I am stuck here for a while and I hope you help me. I have failry large table called NANCAP in a database in where I upload large Excel spreadsheets. There is a filed called code and it can be one digit such as 1,2,3,and so on, and it can be two digits 22,23,50,78 and three digits 100,105. There is not problem with three digits code, but I need two 0's to be added to one and one "0" to be added to two digits code to make like this 003,009,025,050. The code uploaded like this :2,3,50,100,105 .I am trying to do that by using the update query, however I can not fugure out how to put this into query that Access will see where one "0" or two "00" to be added to the filed based on number of digits in the field.
    Thank you in advance for your help.


    Best Regards,

    BorisGomel

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You can DISPLAY the value in a query by creating an alias for the field and the format function:

    MyNewField:Format([OriginalFieldNameHere], "000")

    That will display your field always with 3 digits.

  3. #3
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    add 0

    Thank you veru much sir.

    I did made an update query to this filed "code" and put in update criteria " format([code]),"000) " .Than I incorporate this update query into macro that used to transfer excel files into Access and now it is working nicely.
    A thouthand thank you .
    The Best Reagrds,
    BorsGomel

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Increment a number by "1"... once everyday
    By MikeWooZ in forum Reports
    Replies: 10
    Last Post: 12-01-2011, 01:41 PM
  2. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  3. Fill-in from Badge "number"
    By WestofYouLB in forum Access
    Replies: 2
    Last Post: 04-15-2011, 05:21 PM
  4. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums