Append only part of field record

L

lassang01

I have an MS Access DB and I want to run an append query that can only
append a part of specific field.
I my case field "X" in DB1 have all values starting with (166-) for
example 166-1235, 166-1234...etc
What I would like is that I could only append the values 1235,
1234...etc to field"Y" in DB2.
I hope I will get assistance.
Thanks in advance.
 
M

Marshall Barton

I have an MS Access DB and I want to run an append query that can only
append a part of specific field.
I my case field "X" in DB1 have all values starting with (166-) for
example 166-1235, 166-1234...etc
What I would like is that I could only append the values 1235,
1234...etc to field"Y" in DB2.


In the Select part of the append query, use an expression
like Mid(X, 5) instead of just X
 
R

raskew via AccessMonster.com

Or, if the length of the first part of the string can very:

x = "166-1234"
y = val(mid(x, Instr(x, "-")+1))
? y
1234

Bob
 

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