Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
TestEngineer
Starting Member
29 Posts |
Posted - 2006-03-13 : 15:26:26
|
| I have a table with date values that are currently null.I've created a query that identifies the dates that should go into the date field for the table. I'll call the table "shipping" and the SQL Query, "query".query has the following fields:CN intCSN intshipdate datetimeshipping has the following fields that are relavent:CN intCSN intshipped_date datetimeI want to update shipping, setting shipping.shipped_date=query.shipdatewhere query.cn=shipping.cn and query.csn=shipping.csnHow do I word it to get a proper update using query analyzer? |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2006-03-13 : 15:32:04
|
| UPDATE sSET s.shipped_date = q.shipdateFROM shipping AS sJOIN query AS qON s.cn = q.cnAND s.csn = q.cn |
 |
|
|
TestEngineer
Starting Member
29 Posts |
Posted - 2006-03-13 : 16:25:19
|
| Thanks! That did the trick. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-14 : 01:28:26
|
| Also in SQL Server help file, look for UPDATE (described) under UpdateMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|