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 |
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2009-01-02 : 10:13:24
|
In my Select Query I took out the "-" in the zipcode with this statment below....replace(impact_prod.dbo.pro.pro_zip,'-','') AS [Zip],How can I use this same statement in an update statement for my Billing Zip code. This is what I have......Update #MonthEndProviders Set #MonthEndProviders.[Billing Zip] = replace([Billing Zip],'-','')Would this work? Let me know, thanks! |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2009-01-02 : 10:14:57
|
| yesEm |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-02 : 10:15:54
|
| what happened when you tried to run it? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
werhardt
Constraint Violating Yak Guru
270 Posts |
Posted - 2009-01-02 : 10:24:17
|
Thank you!quote: Originally posted by elancaster yesEm
|
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2009-01-02 : 10:28:02
|
quote: Originally posted by visakh16 Whats the datatype of [Billing Zip]? unless its text or ntext you can use REPLACE. if text of ntext, you need to use method belowhttp://www.sqlteam.com/article/search-and-replace-in-a-text-column
true, but in this case they already said it worked as a select statementEm |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-02 : 10:55:41
|
quote: Originally posted by elancaster
quote: Originally posted by visakh16 Whats the datatype of [Billing Zip]? unless its text or ntext you can use REPLACE. if text of ntext, you need to use method belowhttp://www.sqlteam.com/article/search-and-replace-in-a-text-column
true, but in this case they already said it worked as a select statementEm
but the field they gave in select statement was different (it was impact_prod.dbo.pro.pro_zip not #MonthEndProviders.[Billing Zip]) |
 |
|
|
|
|
|