Query confusion

Pharcyde

Arriba Arriba!!!
Local time
Today, 16:53
Joined
Sep 4, 2003
Messages
116
My posts seem to be getting more and more retarded...

Say I have 3 different groups, "FC", "BLR" and "CON":
FC has been allocated a value for all customers, and I would like to copy that value into BLR and CON, again for all customers.
Oh yeah, the groups are all in the same table, if that makes any difference

I Just can't seem to get the update query quite right...Could anyone help please?

Lee
 
Last edited:
To copy all values from field1 to field2 use this update query (change it to your needs)

UPDATE YourTable SET YourTable.Field2 = [yourtable].[field1];

Regards

The Mailman
 
I'm confused by your use of the term Group. If FC, BLR & CON are all field names, this should work. Be sure to back up your table before trying.
Code:
UPDATE MyTable SET MyTable.BLR = [FC], MyTable.CON = [FC];
HTH-
Bob
 
Yeah sorry it wasn't very clearly explained.

The field name is 'ModuleCode' - 'FC' etc. are all entries in the field

Also 'Group' is a field name, with corresponding int values.

So i need (for each customer) the value where 'ModuleCode' ='FC', copied into 'ModuleCode' ='BLP', etc, etc... - so that they all have the same value as FC.

Is that a little clearer? I bet not! It's still morning...;)
 
In that case its an append query something like below (you still need to add the customer number)

INSERT INTO YourTable ( ModuleCode, Group )
SELECT "BLP" AS NewModuleCode, YourTable.Group
FROM YourTable
WHERE YourTable.ModuleCode="FC";


Regards
 

Users who are viewing this thread

Back
Top Bottom