add new extension in the records of a colum

eon

New member
Local time
Today, 07:56
Joined
Feb 11, 2008
Messages
2
I am new here and dont know much about access but I have to do some things.

I have a table filled in access. This table (dlb_tbl) contains serveral colums. One colum named "type". The records of this colum has to be changed like this:

one record: 0RD00S101
this has to be changed into: EDH01-RD00S101

So there has to come a new extension EDH01- and the 0 has to be deleted. This has to be done to the whole colum. How can I make a query to do this?:o
 
Hello eon!

Look at "DemoNewExtA2000.mdb" (attachment).
Look at table, Query1UPD (update query). Run query and look at table.
It allude that the lenght of the field "type" is the same in all records
(9 letters). I think it is what you need.
 

Attachments

UPDATE dlb_tbl SET dlb_tbl.[type] = 'EDH01-RD00S101'
WHERE dlb_tbl.[type] ='0RD00S101'

as mentioned by MStel... make sure the length of column "type" is > 15
 
Thanks for the reply..

I have tested the solution of MStef this is working wel!

But I have now a new challege.. I have aroung 80.000 records in that same colum. Some of these has to be changed to "EDH01" and others to EDH02/03 and so on.

How should I do this.. Should I work with If Else statements? Is that good in SQL ?
 
It can be done via query (update) with criteria.
In that case you have to run a query more times, (always with a new CRITERIA and a new UPDATE TO).
The Other way is via VBA, it require a programing.
 

Users who are viewing this thread

Back
Top Bottom