Can I add a suffix using an Update query?

David Ball

Registered User.
Local time
Tomorrow, 02:06
Joined
Aug 9, 2010
Messages
230
Hi,

I have a database with a field for Equipment Numbers (eg 4510PU0102). There are around 250 records and I need to add the suffix "-PLC" to each equipment number (eg 4510PU0102-PLC).

I set up a simple query to return all Equipment Numbers then tried to change it to an Update query with []+"-PLC" in the "Update To" row. The problem is it brings up the criteria box and asks for a criteria.

I just want to add "-PLC" to all existing Equipment Numbers.

Is there a way to do this with an Update query?

Or is there a better way to do this?


Thanks a lot

David Ball
 
Sure; in the update to:

FieldName & "-PLC"

In SQL view it would look like

UPDATE TableName
SET FieldName = FieldName & "-PLC"
 
Thanks, but I still can't get it working.
If I have:

UPDATE tblEquipment SET tblEquipment.strfldEquipmentNo = "strfldEquipmentNo" & "-PLC";

in the SQL view and run it, it changes the first of my Equipment Numbers (4510PU1020) to "strfldEquipmentNo&-PLC" (instead of 4510PU1020-PLC as intended) and leaves the other 266 unchanged.

Dave Ball
 
Try

UPDATE tblEquipment SET tblEquipment.strfldEquipmentNo = [strfldEquipmentNo] & "-PLC"
 
Happy to help, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom