Why would you want to do this? What would make you choose a 3 or a 2?

--

Tom

---------------------------------------------------------------

Thomas A. Moreau, BSc, PhD, MCSE, MCDBA

SQL Server MVP

Columnist, SQL Server Professional

Toronto, ON Canada

www.pinnaclepublishing.com/sql

"Meenal Dhody" <com> wrote in message news:phx.gbl...

Currently I have a Case statement in an update statement that looks like

this:

update #MeetingsTmp set MeetingCount =

(select count(*) from meeting m

where m.companyid = mt.companyid

and m.MeetingDate = mt.MeetingDate

and MeetingTypeID = (CASE mt.MeetingType WHEN 'A' THEN 0

WHEN 'C' THEN 4

WHEN 'S' THEN 3

WHEN 'U' THEN 6

WHEN 'R' THEN 0

WHEN 'T' THEN 3

WHEN 'V' THEN 3

WHEN 'W' THEN 3

WHEN 'X' THEN 3

WHEN 'Y' THEN 3

WHEN 'Z' THEN 1

WHEN 'P' THEN 3

WHEN 'S' THEN 3

WHEN 'Q' THEN 3

ELSE convert(tinyint, MeetingType) END)

and MeetingStatusID NOT IN (0,1,2,3,8,9) and ConfirmedYN = 1)

from #MeetingsTmp mt with (NOLOCK)

where MeetingCount > 1

I want to know it there a way to continue to use a case statement but say

something like:

WHEN 'X' THEN 3

WHEN 'X' THEN 2

Basically one value in the WHEN clause goes to 2 values in the THEN

statement.

I appreciate any help.

thanks,

Meenal

## Bookmarks