dbTalk Databases Forums  

update query to rplace last two characters in field

comp.database.ms-access comp.database.ms-access


Discuss update query to rplace last two characters in field in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Bevins
 
Posts: n/a

Default update query to rplace last two characters in field - 01-23-2005 , 09:15 PM






Hi all,

i am trying to run an update query to replace the last two characters in a
field to no avail.
I think I am going about it wrong. I would like a few suggestions please on
how to perform this task.

I am trying with the replace function then mid$ last two characters and
trying update
I am gett erratic changes.


an example of one record/field data is as follows:

012004

and it needs to be :
01202004

Thanks in advance

Bob








Reply With Quote
  #2  
Old   
Ken Snell
 
Posts: n/a

Default Re: update query to rplace last two characters in field - 01-24-2005 , 08:42 AM






Post what you've tried... we don't know what that is.

Assuming that these are the data and what the data should be:
012004 should be 01202004
011904 should be 01192004
110304 should be 11032004

etc., then an update query would look something like this:


UPDATE MyTableName
SET MyFieldName =
Left([MyFieldName], 4) & "20" &
Right([MyFieldName], 2);

--

Ken Snell
<MS ACCESS MVP>



"Bob Bevins" <bob (AT) virteck (DOT) com> wrote

Quote:
Hi all,

i am trying to run an update query to replace the last two characters in a
field to no avail.
I think I am going about it wrong. I would like a few suggestions please
on
how to perform this task.

I am trying with the replace function then mid$ last two characters and
trying update
I am gett erratic changes.


an example of one record/field data is as follows:

012004

and it needs to be :
01202004

Thanks in advance

Bob




----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000
Newsgroups




Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.