bob
3/22/2007 12:10:00 PM
If the column is NULL, not '', you can use COALESCE, which returns the first
non-null column:
SELECT COALESCE( FullDesc, ShortDesc )
Simpler than CASE right!?
wBob
"Doug" wrote:
> Question for the SQL gurus: I have a table that has two text columns, named
> ShortDesc and FullDesc. The users didn't start using the FullDesc field
> until a few years ago, it is blank in most of the records that are more than
> 3 years old. I want to write a query that returns the FullDesc column when
> it is not blank, otherwise returns the ShortDesc column.
>
> Kind of like an iff function in Excel -- iff(FullDesc = "", ShortDesc,
> FullDesc).
>
> Is this possible in SQL?
>
>
>