Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function List for SQL 2000 1

Status
Not open for further replies.

Mantle51

Programmer
Aug 17, 2006
97
0
0
US
Hi,

I'm trying to create a select statement that determines if a single character in a field(the field is only one character) equals 'M'. I don't see IIF function available in SQL 2000 and I cannot use IF Then syntax in a SELECT statement. So how is this achieved without using a UDF?

Many thanks...........
 
Code:
SELECT
   IsItM = CASE WHEN TheField = 'M' THEN 'YES!' ELSE 'No Way' END,
   *
FROM MyTable

SELECT *
FROM MyTable
WHERE TheField = 'M'

[COLOR=black #d0d0d0]When I walk, I sometimes bump into things. I am closing my eyes so that the room will be empty.[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top