RE: leading zeroes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The query should look like that

UPDATE MyTableName SET B = Format([A],"0000000000000");


"ljubo lecic via AccessMonster.com" wrote:

> I have a table with two columns.(A Number, B text (13 char in size))
> I need to write an update query which would make column B
> to look like column A but with leading zeroes.
> For example:
> If A = 1234 B should be 0000000001234 or
> If A = 1 B should be 0000000000001
>
> Thanks in advance!
>
> --
> Message posted via http://www.accessmonster.com
>
.



Relevant Pages

  • RE: binding multiple values and retain blanks
    ... Join this table to the main table in your query. ... When i do like above, trailing spaces are lost, as DBI treats default ... So i have to bind one value at a time and specify type as CHAR in order ...
    (perl.dbi.users)
  • Re: % wildcart problem
    ... When a comparison is made to a Char type and the length of the right-hand side of the expression does not match the char length, ... exec sp_executesql N'SELECT PkCountryId, Flag, CodeA2, CodeA3, Name, ... FROM Country ... > When I execute this query via the query builder, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Query produces incorrect results
    ... I got sample of 4 rows for Location table, State column 255 char ... > Doug Steele, Microsoft Access MVP ... >> I need help with a query that produces results out side of the USA states. ...
    (microsoft.public.access.gettingstarted)
  • Re: SQL Query problem take ages to run
    ... When you run the select query, how long does it take to start returning ... with few if any duplications in the parent table, ... PtNo char NOT NULL, ... Adm_Unit_Dt datetime, ...
    (microsoft.public.sqlserver.programming)
  • Re: Tuning query?
    ... >critical column is ... >thats right its a char column... ... >adding disbursementnumber as a comparison in the where clauses adds 10,000 ... some nonclustered index covers the query (contains all the information ...
    (microsoft.public.sqlserver.programming)