473,387 Members | 1,798 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,387 software developers and data experts.

modify table field

ken
I have a field in table "Jobs" called "JobNo" consisting of 6 numbers
such as 405043
I need to somehow delete the first 3 numbers to have field just be
043
I could delete the first 3 numbers by hand but have 9600 records in
table

Thanks for any and all suggestions
Ken

Oct 29 '06 #1
3 1756
ken wrote:
I need to somehow delete the first 3 numbers to have field just be
043
Make a backup of your table first, just in case something goes wrong. Run an
update query like this:

UPDATE Jobs
SET JobNo = Mid(JobNo, 4);

The leading zero won't stay unless this is a text column.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200610/1

Oct 29 '06 #2
first, make a COPY of your database, and use the COPY for the next steps
(always pays to have a backup, when you're making changes to data en masse).

use an Update query to make the change, as

UPDATE TableName SET TableName.FieldName = Right([TableName].[FieldName],3);

replace TableName and FieldName with the correct table and field names, of
course.

hth
"ken" <ke******@yahoo.comwrote in message
news:11*********************@e64g2000cwd.googlegro ups.com...
I have a field in table "Jobs" called "JobNo" consisting of 6 numbers
such as 405043
I need to somehow delete the first 3 numbers to have field just be
043
I could delete the first 3 numbers by hand but have 9600 records in
table

Thanks for any and all suggestions
Ken

Oct 29 '06 #3
"ken" <ke******@yahoo.comwrote in
news:11*********************@e64g2000cwd.googlegro ups.com:
I have a field in table "Jobs" called "JobNo" consisting of 6
numbers such as 405043
I need to somehow delete the first 3 numbers to have field
just be 043
I could delete the first 3 numbers by hand but have 9600
records in table

Thanks for any and all suggestions
Ken
Well if you have 9600 records, and only three digits, jobno will
have duplicates. That may be a problem in itself.

If JobNo is a text field, just use the right() function to
return the three rightmost digits.
If JobNo is truly a number, you can either convert to text
before and after or calculate the remainder from 1000
use the mod operator for this
Make a backup table to test first, then build an update query
with the replace set to ([Jobno] mod 1000)
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Oct 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
2
by: Danny | last post by:
How to allow users to select a set of records and then let them change a field for all these records at once? I would like to do this in code on a form. I will have a form with tabular view of...
4
by: John | last post by:
I am using code provided by Mr. Steele that allows for my MDB to dynamically connect to remote SQL server databases. The code works fine as follows: Type TableDetails TableName As String...
6
by: Giuseppe Chielli | last post by:
Hi to everyone! I'm new in this NG. I'm posting this message just for learning how can I modify the type of a field in a table via VBA code. Is that possible? And is anyone so kind to post me some...
4
by: MikeY | last post by:
Hi everyone, I have posted earlier this week, but I'm still scratching my head trying to figure out how to change/modify my data back to my db. Using C# Windows forms. I am trying to learn how...
0
by: dumbo | last post by:
I do not succeed to modify the content of a MaskedTextBox control whose Property "OutputText" is in binding with field of type text of one table in database a MDB. The control has been generated...
2
by: Khundeen | last post by:
Hi, I am trying to modify the primary key of a table. We need to add new field and make it part of the Primary key of the table. I thought I can use this SQL Statement. ALTER TABLE...
0
by: JDS | last post by:
I have a table with the primary key as a uniqueidentifier / GUID and the rowguid property set (it is used for replication). When creating a data table in a dataset in VS2005 the table adapter...
5
by: Brett Barry: Go Get Geek! | last post by:
Hello, Can someone please paste VBA code and how I would go about doing this?: I have a customer table with over 6000 duplicates in the field called "Customer". While the customer names may...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.