copy the values from one record to another

geo__

Registered User.
Local time
Today, 21:14
Joined
Nov 28, 2003
Messages
13
Hi,

I have a table and want to copy the values from one record to another.

For instance I want to copy all the values from record with ID 100 to record with ID 110.

Why would I want something like that? Because a user mistakenly placed the record at 100 instead of 110.

Then the 100th record will be filled with something else or go blank.

I am wondering if i can do this with sql only.

Thanks,
George
 
George,

If its an updateable key, then a simple Update query will do
it for you.

Wayne
 
can you elaborate please?

Hi Wayne,
Thanks for your answer on Christmas day.

Well, I can't think of how a simple query can do this.
Lets assume I have only 3 fields, ID, firstname, lastname,
and I want to move firstname,lastname from ID 10 to ID 11.

update mytable set firstname=?????, lastname=???? where ID=11

What should I put in the ???? ?

The following solution crossed my mind.
How about putting select firstname from mytable where ID=10 ?
but then I would have loads of selects.
Is there any simpler solution?

Thanks,
George
 
George,

From what you are saying, the field you are
trying to change is an AutoNumber. You won't
be able to do it. Autonumbers are just a way
of assigning unique numbers to your records.

They are not guaranteed to be sequential
(delete records). They are just identifiers.

If you are trying to enforce some sort of
numbering system, Then there are many posts
on this forum for handling things like
Invoice Numbers, etc.

Need more info.

Wayne
 

Users who are viewing this thread

Back
Top Bottom