October 11, 2005 at 1:53 pm
New at some of this scripting - have a table that has multiple fields with dates - I need to have the date in column B the same as the date in column A - keep running into a problem using update or do I have to have a select statement first -
Greatly appreciate any help!!!
THANKS
October 11, 2005 at 2:23 pm
UPDATE TableName SET
CoumnB = ColumnA
[Note: this update will change the all of the values for ColumnB since there is no WHERE statment. Is this what you want?]
I wasn't born stupid - I had to study.
October 11, 2005 at 2:48 pm
Yes - do I have to put in a statement selecting a database?
October 11, 2005 at 2:59 pm
I was working under the assumption that you were doing this from Query Analyzer with the database already defined. Where are you planning on running this statement?
I wasn't born stupid - I had to study.
October 12, 2005 at 3:07 am
Question - if the dates in both columns have to be the same, what exactly are they used for? Why do you then need both columns? Column B seems redundant.
If you must also ensure this for future data, you could alter column B to be to be derived automatically from Column A.
October 12, 2005 at 8:12 am
This is the correct approach if in fact both fields are always the same...
I wasn't born stupid - I had to study.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy