CASE Statement

  • Thread starter Thread starter postmaster
  • Start date Start date
P

postmaster

I am pulling my hair out to write the following SQL Server query in
Access. What is the equivalent of CASE in access please?

SELECT [ID] ,
0.0 AS [std-deviation],
SUM( CASE
WHEN lob ="R" THEN [loss netded]
WHEN lob = "C" THEN [dam gross]
WHEN lob = "M" THEN [dam gross] END) AS LOSS
FROM tblEventLosses
 
Already answered in another newsgroup to which you posted the same question.

If you feel you need to post to more than one group (HINT: it's seldom
necessary), please have the courtesy to cross-post (send the one message to
all groups at once), rather than multi-post (send individual messages to
each group). In this way, all responses to your post will be available
together, regardless of what group the responder was in, and the rest of us
won't have to read your post multiple times. (It also uses fewer server
resources)

You seem to be using Mozilla to post. I'm afraid I'm not sure about how to
cross-post using Mozilla, but in other products, you'd type each of the
newsgroup names in the Newsgroups line, separating each name with a comma or
semicolon.
 
Back
Top