If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

QE-DEF-0405 & QE-DEF-0260

Started by esanray, 15 Nov 2011 08:19:25 PM

Previous topic - Next topic

esanray


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



HalfBloodPrince

#1
Try this
if ([GSM].[No_PAC] = [GSM].[NO_IN_COM] )
then ('ok')
else
(cast(count ( distinct[GSM].[TRAIN_NO] ),varchar(5)) )

blom0344

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