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 |
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2004-08-09 : 15:18:14
|
| This is my coding so far:SELECT MailAddress,PropAddress,(CASE WHEN MailAddress IS NULL THEN PropAddress ELSE MailAddress END)FROM tblCapRecIt is not inserting into the table though. It displays it into a new "made-up" column, but it doesn't replace the NULL with a mailing address. Any ideas?Thanks! Brenda |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-08-09 : 15:22:21
|
| Ok...This will show you what you're going to change:Select newMailAddress = isnull(MailAddress,PropAddress), oldMailAddress = MailAddress, PropAddress From tblCapRecThis will change it:for update:Update tblCapRecSet MailAddress = isnull(MailAddress,PropAddress)From tblCapRecfor insert into new table:Insert Into YourNewTableNameSelect MailAddress = isnull(MailAddress,PropAddress), PropAddressFrom tblCapRecDoes that get it?Corey |
 |
|
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2004-08-09 : 15:37:05
|
| I need to do something like this, but it won't work:Update tblCapRecSet MailAddress = ISNULL(MailAddress,PropAddress)Set MailCity = ISNULL(MailCity,PropCity)Set MailState = ISNULL(MailState,PropState)Set MailZipCode = ISNULL(MailZipCode,PropZipCode)From tblCapRecWhat do I need to change? Brenda |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-08-09 : 15:38:05
|
| put commas in:Update tblCapRecSet MailAddress = ISNULL(MailAddress,PropAddress),MailCity = ISNULL(MailCity,PropCity),MailState = ISNULL(MailState,PropState),MailZipCode = ISNULL(MailZipCode,PropZipCode)From tblCapRecCorey |
 |
|
|
brendalisalowe
Constraint Violating Yak Guru
269 Posts |
Posted - 2004-08-09 : 15:43:08
|
| Works perfect! Thanks Corey! |
 |
|
|
|
|
|
|
|