By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,415 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

concatenating two fields - problem with leading zeros

P: n/a
In a select query I am attempting to combine two fields:

One where Field1 = "AL" the other Field2 = "01"

I am writing:

NewString = [Field1] & [Field2]

Even though Field2 is a string, the leading zero gets removed and the result is:

"AL1"

and not my desired "AL01"

How can I maintain the leading zeros?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
try this:

[field1] & format([field2], "00")

or

[field1] & format([field2], "AA")

Just have a look under the format in the help to see what format suits best.

- Nicolaas
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.