A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text manipulation in update query



 
 
Thread Tools Display Modes
  #1  
Old December 10th, 2009, 03:21 PM posted to microsoft.public.access.queries
Tony in Michigan[_2_]
external usenet poster
 
Posts: 23
Default Text manipulation in update query

I want to compare two tables, in order to update fields in either table. The
fields that I am matching on are text.
Table 1 field key_num
xxx-1234567-8_nn
Table 2 field key_num
xxx12345678

How can I parse out the hyphens and the _nn portion, so I can match on the
fields?
  #2  
Old December 10th, 2009, 03:43 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default Text manipulation in update query

Mid([table1],1,13) Start at the 1st character and show the next 13.
--
Milton Purdy
ACCESS
State of Arkansas


"Tony in Michigan" wrote:

I want to compare two tables, in order to update fields in either table. The
fields that I am matching on are text.
Table 1 field key_num
xxx-1234567-8_nn
Table 2 field key_num
xxx12345678

How can I parse out the hyphens and the _nn portion, so I can match on the
fields?

  #3  
Old December 10th, 2009, 03:51 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Text manipulation in update query

I think Milton missed a few specs in the question. Bottom line is you want an
update query to match on expressions that are not primary/foreign keys. I
doubt you can get an Access query to do this.

The expression might be
Replace(Replace(Table1.Key_Num,"-",""),"_nn","")

You might be better off creating and updating a new field so you can create
a primary/foreign key relationship.

--
Duane Hookom
Microsoft Access MVP


"golfinray" wrote:

Mid([table1],1,13) Start at the 1st character and show the next 13.
--
Milton Purdy
ACCESS
State of Arkansas


"Tony in Michigan" wrote:

I want to compare two tables, in order to update fields in either table. The
fields that I am matching on are text.
Table 1 field key_num
xxx-1234567-8_nn
Table 2 field key_num
xxx12345678

How can I parse out the hyphens and the _nn portion, so I can match on the
fields?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.