How do I convert 06-1606 to 200601606 in a query (expres. build)?

G

Guest

I am building a query that captures alot of info, to feed into another
database. However, the access db has the old ID and the new database has the
new ID. I need to convert 06-1606 to 200601606 (as an example). Any ideas?
 
G

Guest

If you want to get text output, set the UpdateTo for the NewID to be:

"20" & Left([OldID],2) & "0" & Right([OldID],Len([OldID])-3)

If you want numeric output:

Val("20" & Left([OldID],2) & "0" & Right([OldID],Len([OldID])-3))

This assumes you want "20" in front of each one. If you want something else,
replace it with a reference to the data that goes there instead of "20". If
the lengths differ, you may have to adjust also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top