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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenation

Status
Not open for further replies.

iainrkemp14

IS-IT--Management
May 13, 2003
26
US
I am trying to write an update query that will update column B with 5 zeros and the contents of column A.

For example:

Column A = 12345
Column B = 0000012345

How can I do this? I have tried "00000"&[Column A] but that doesn't seem to work.

Cheers,

- Iain
 
Try this:

Right("0000000000" & trim (Val ([Column A])), 10)

This will result in having up to 10 trailing zeros, no matter how big your number is. So if column a has 1, it will return 0000000001. If it is 10, it will return 0000000010, with out having to do any iif statements.

Hope this helps.

Thank you,
Charles Smith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top