I am having an issue getting a record produced if my count = 0.
Basically my query is counting logons based on some criteria, but if there has never been a logon for a specific customerID I still want it to show as 0.
I have tried IFNULL on the count but with no joy.
SELECT
CUSTOMERID,
CASE
WHEN STATUSCODE = 600 THEN 'Successful Logon'
ELSE 'Unsuccessful Logon'
END as LogonStatus,
COUNT( * ) COUNTOFACCOUNTS
FROM
SCEMEA.TABLENAME
WHERE
CUSTOMERID in ('"+join(Parameters!CustomerID.Value, "','")+"')
AND (Cast(DATETIME as Date) >= '"& Format(Parameters!FromDate.Value, "yyyy-MM-dd") & "'
AND Cast(DATETIME as Date) <= '" & Format(Parameters!ToDate.Value, "yyyy-MM-dd") & "')
AND COMPONENTDESCRIPTION = 'RandomText'
AND METHOD = 'RandomText'
GROUP BY
CUSTOMERID,
CASE
WHEN STATUSCODE = 600 THEN 'Successful Logon'
ELSE 'Unsuccessful Logon'
END
ORDER BY
CUSTOMERID ASC
Please let me know if you need anymore information, any help would be appreciated.