How do I move data from one column to another? (1 Viewer)

davidg47

Registered User.
Local time
Today, 05:02
Joined
Jan 6, 2003
Messages
59
If I want to move all of the data from Column A to Column B, deleting the data from Column A, and making sure the data stays with the same row, how do I do that?

Would it be something like:

update tablename
set [dateB]=[dateA];

del [dateA];

I am only guessing here...

Thanks,
David
 

FoFa

Registered User.
Local time
Today, 04:02
Joined
Jan 29, 2003
Messages
3,672
Your update is basically good, but don't use delete, use another update instead.
Update tablename
SET [dateA] = NULL
 

Brian1960

Brian1960
Local time
Today, 10:02
Joined
Aug 13, 2004
Messages
141
Sql

HI,
Not a bad attempt.

Code:
Update tblName set fieldA = fieldB;
Update tblName set fieldB = null;

Hope this helps,
B
 

davidg47

Registered User.
Local time
Today, 05:02
Joined
Jan 6, 2003
Messages
59
perfect... thanks guys. I'll let you know how it goes.
 

Users who are viewing this thread

Top Bottom