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 |
Pasi
Posting Yak Master
166 Posts |
Posted - 2014-03-26 : 19:35:44
|
HI,I have a column called person.last_name, and I want to set this field to NULL if person.last_name ='test'I have tried this but don't work: ISNULL({person.last_name},'<>"test'))Thanks! |
|
nagino
Yak Posting Veteran
75 Posts |
Posted - 2014-03-26 : 19:52:59
|
UPDATE person SET last_name = null WHERE last_name = 'test'-------------------------------------From JapanSorry, my English ability is limited. |
|
|
Pasi
Posting Yak Master
166 Posts |
Posted - 2014-03-26 : 22:47:31
|
Thanks Nagino but this is not what I am looking for , I don't want to update or overwrite a table in sql I ma accessing the SQl from my app and want to write the formula to say if the column has "test" in it, ignore it or set it to null. looking for formula to do the condition for me.Pasi |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-03-26 : 23:14:23
|
[code]NULLIF ( person.last_name , 'test' )[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
Pasi
Posting Yak Master
166 Posts |
Posted - 2014-03-27 : 01:16:36
|
Thanks! hope this works. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-03-27 : 01:26:15
|
keep your finger cross KH[spoiler]Time is always against us[/spoiler] |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-03-28 : 06:04:56
|
orcase when person.last_name = 'test' then NULL else person.last_name endMadhivananFailing to plan is Planning to fail |
|
|
Pasi
Posting Yak Master
166 Posts |
Posted - 2014-04-02 : 14:47:16
|
Thanks Madhivanan I will try that!Pasi |
|
|
|
|
|