Please find bellow the Query
case when[GSM].[No_PAC] <>[GSM].[NO_IN_COM] then count ( distinct[GSM].[TRAIN_NO] ) else 'ok'
end
This Query give the following error.
QE-DEF-0405 Incompatible data types in case statement.
then i write the query with if condition
if ([GSM].[No_PAC] = [GSM].[NO_IN_COM] then 'ok' else count ( distinct[GSM].[TRAIN_NO] )
then it display
QE-DEF-0260 Parsing error before or near position
Please check the quey and correct
i need the report to display like this
10.00 5
11.00 4
12.00 ok
13.00 2
14.00 ok
Try this
if ([GSM].[No_PAC] = [GSM].[NO_IN_COM] )
then ('ok')
else
(cast(count ( distinct[GSM].[TRAIN_NO] ),varchar(5)) )
No that will not work.. Either true/false the outcome must be the same datatype..
case when[GSM].[No_PAC] <>[GSM].[NO_IN_COM] then count ( distinct[GSM].[TRAIN_NO] ) else (0) end