Hello:
Giving the following query:
SELECT M. POLICY_ID, EXRTCD=
( CASE WHEN COUNT(DISTINCT M.STATE_ID) > 1 AND
COUNT(DISTINCT M.ACTION_CODE_ADJ_VALUE_INPUT) > 1 THEN '3' END)
FROM WCPS.PERIOD_ACTION_CODE AS M
GROUP BY M.POLICY_ID;
I get an error stating there is something wrong in my syntax, this works im Ms Sql 7.0. I checked the help area in sybase for the count syntax the distinct verb is valid the only part that I'm not sure of is the AND.
Sybase does not like two count statements with distincts any ideas are welcomed.
Giving the following query:
SELECT M. POLICY_ID, EXRTCD=
( CASE WHEN COUNT(DISTINCT M.STATE_ID) > 1 AND
COUNT(DISTINCT M.ACTION_CODE_ADJ_VALUE_INPUT) > 1 THEN '3' END)
FROM WCPS.PERIOD_ACTION_CODE AS M
GROUP BY M.POLICY_ID;
I get an error stating there is something wrong in my syntax, this works im Ms Sql 7.0. I checked the help area in sybase for the count syntax the distinct verb is valid the only part that I'm not sure of is the AND.
Sybase does not like two count statements with distincts any ideas are welcomed.