Jump to content

Recommended Posts

Posted

Hi Team,

I'm currently working on trying to get number of services by request types

I've got the following code:

SELECT h_fk_servicename,
SUM (CASE WHEN h_requesttype = 'Incident' THEN 1 ELSE 0 END) AS incident
FROM h_itsm_requests
WHERE h_datelogged between '19-01-01' AND '19-01-31'
GROUP BY h_fk_servicename

and when I run it I get the following error:

image.png.48566de77dcfdd0795a1ba34e1b8eaae.png

I was wondering if you might be able to shed some light on this.

I'm trying to see if I can get a count to work in a CASE statement.

Many thanks,

Mojahid

Posted

You managed to get a space between SUM and the initial bracket. Changing "SUM (" to "SUM(" should do it

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...