Replace Column Value

zezo2021

Member
Local time
Today, 12:48
Joined
Mar 25, 2021
Messages
412
friends
I have Column
Qcode
have the same value of the first column
23
36
I need to create a new column
remove the value
23
36
form column Qcode and
Replace it with column 3 row materialCode

What should I do
 

Attachments

  • Query.png
    Query.png
    23 KB · Views: 258
I presume this is a table? If so, why are you wanting to duplicate data? And what is the new column you need to create?

have you tried using an update query to update QCode with the value from materialCode?
 
I presume this is a table? If so, why are you wanting to duplicate data? And what is the new column you need to create?

have you tried using an update query to update QCode with the value from materialCode?

Hello
An update query is a good idea

It's not a table
It is a Select query that contains expression

RawMaterialCode is an expression compound with a lot of fields

but I need to do it using Select query since there shared field value here
 
Last edited:
deleted - response to wrong post

I'm now confused - perhaps show the sql to your query as it would seem you just need to rename a columns
 
Code:
SELECT RawMaterrialsInventory.RowMaterrialsInventoryID, RawMaterrialsInventory.RowMaterialID, RawMaterrialsInventory.TransactionType, RawMaterrialsInventory.Inventory_Quantity_Raw_Materrial, RawMaterrialsInventory.TransactionDate, RawMaterrialsInventory.StoresTransactionID, RawMaterrialsInventory.[PO#], RawMaterrialsInventory.ExpirationDate, [RawMaterials].[RawMaterials] & " " & [SupplierName] & " " & [ExpirationDate] AS RowMaterialCode, Suppliers.SupplierName, Clients.ClientName, RawMaterrialsInventory.OCode
FROM ((RawMaterrialsInventory LEFT JOIN RawMaterials ON RawMaterrialsInventory.RowMaterialID = RawMaterials.RowMaterialID) LEFT JOIN Suppliers ON RawMaterrialsInventory.SupplierID = Suppliers.SupplierID) LEFT JOIN Clients ON RawMaterrialsInventory.ClientID = Clients.ClientID;
 
RowMaterrialsInventoryID value = OCode

RowMaterrialsInventoryID is auto number
QCode inserted by code
 

Users who are viewing this thread

Back
Top Bottom