473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Update part of a data string with an Update query -ACC97

Hi.
I'm trying to run an update query in ACC97 to update a data string where only part of the data needs to be changed. Since I don't do this often, I cant for the life of me remember how to do it.

Here'w what the data looks like: 10-1100-120-000-10-10-00-000
I need to change only this portion: 10-1100-120-000-10-10-00-000

Any ideas on how to do this in a query?

Thanks.
Kevin
Feb 20 '07 #1
4 4118
ADezii
8,834 Expert 8TB
Hi.
I'm trying to run an update query in ACC97 to update a data string where only part of the data needs to be changed. Since I don't do this often, I cant for the life of me remember how to do it.

Here'w what the data looks like: 10-1100-120-000-10-10-00-000
I need to change only this portion: 10-1100-120-000-10-10-00-000

Any ideas on how to do this in a query?

Thanks.
Kevin
Assuming the Field containing the data is called [Test], and its length is a consistent 28 characters long, then:
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest SET tblTest.Test = Left$([Test],8) & "<your 3-digit-value here>"   & Right$([Test],17)
  2. WHERE tblTest.Test Is Not Null;
Feb 20 '07 #2
Assuming the Field containing the data is called [Test], and its length is a consistent 28 characters long, then:
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest SET tblTest.Test = Left$([Test],8) & "<your 3-digit-value here>"   & Right$([Test],17)
  2. WHERE tblTest.Test Is Not Null;
Thanks! It worked great! Sometimes there's just too much going on in my little head to remember snipets of code!

Greatly appreciated!
Kevin
Feb 21 '07 #3
ADezii
8,834 Expert 8TB
Thanks! It worked great! Sometimes there's just too much going on in my little head to remember snipets of code!

Greatly appreciated!
Kevin
No problemo.
Feb 21 '07 #4
NeoPa
32,556 Expert Mod 16PB
A (slightly) more flexible version which allows for varying lengths in the field [Test] would be :
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest
  2. SET [Test] = Left([Test],8) & "[Your Replacement]" & Mid([Test],12)
  3. WHERE [Test] Is Not Null
Feb 23 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mohammed Mazid | last post by:
Can anyone please help me here? Basically I have modified the source code and understood it but when I update a record in the db using a JSP, it gives me an error "The flight you selected does...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
2
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third...
3
by: Ken Bush | last post by:
How can I write an update query that removes part of a field? Like if I have a field with values such as 8/3/68 (a birthday obviously) and I need to put values in a new column but I need...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
11
by: Siv | last post by:
Hi, I seem to be having a problem with a DataAdapter against an Access database. My app deletes 3 records runs a da.update(dt) where dt is a data.Datatable. I then proceed to update a list to...
5
by: parwal.sandeep | last post by:
Hello grp! i'm using INNODB tables which are using frequently . if i fire a SELECT query which fetch major part of table it usually take 10-20 seconds to complete. in mean time if any UPDATE...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
1
beacon
by: beacon | last post by:
Hi everybody, I have an Employee table with the following: Table - Employee -------------------------- ID: AutoNum, PK FName: Text LName: Text Status: Yes/No
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.