Re: conditions in the select clause?
- From: "Jeff L" <jleckrone@xxxxxxxxxxx>
- Date: 17 Aug 2006 08:12:21 -0700
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
.
- Prev by Date: Re: Null values in date range, multiple criteria
- Next by Date: Re: Querying multiple initials fields for report
- Previous by thread: Re: Null values in date range, multiple criteria
- Next by thread: Re: Updating from Many records to one table
- Index(es):