0

下午所有,

我目前正在尝试编写一个 case when 语句将超过 12 个字符的任何内容替换为 '' 。似乎无法获得正确的语法,想知道是否有人有任何指示?

CASE WHEN Field1 = LEN(Field1) >12 THEN '' ELSE Field1 END

谢谢

4

1 回答 1

4

Get rid of the Field1 = part right after the WHEN (the part between WHEN and THEN must be a boolean expression ONLY). I'm guessing you want that outside the CASE expression altogether since you can't do assignments inside a CASE expression.

Field1 = CASE LEN(Field1) > 12 THEN '' ELSE Field1 END
于 2013-07-26T14:35:04.747 回答