Re: conditions in the select clause?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Select iif(Len(Field1) < 3, "Yes", "No")....

Hope that helps!


Rick wrote:
Hi:

IN SQL Server you can put conditions to the fields on the SELECT clause by
using
CASE, WHEN, THEN, ELSE, END.

Is there a way to put conditions to the outputs of a field?

for example:

SELECT CASE WHEN LEN(Field1)< 3 THEN "Yes" else "No" end AS MyFieldName,
Field2, Fikeld3
From MyTable

(this is possible in SQL 2000)



--
Rick

.