Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASE Statement

Status
Not open for further replies.

IAMINFO

MIS
Feb 21, 2002
62
0
0
US
I am trying my first statement, I am not sure why I am getting an error.

I am try to say if the transaction type (TXTYPE)= 'OPENING BALANCE'
then show all transactions from 0 to 50$

If not show all transactions that are purchases represented
by < 0

CASE

IF ([SQL1].[TXTYPE])= 'OPENING'

THEN ([SQL1].[AMOUNT] > 0) AND ([SQL1].[AMOUNT] <=50 )

ELSE ([SQL1].[AMOUNT] < 0)


Please point me in the right direction.
Thank you
 
And the Cognos product you are using is...?

Syntax can often be
CASE WHEN condition THEN statement ELSE statement END

soi là, soi carré
 
thank you drlex for taking time , i am using Report Studio 8.2
 
Why do you need the Case Statement, why not use the if then else?

I think your parentheses were in the wrong place:

IF ([SQL1].[TXTYPE]= 'OPENING' )THEN ([SQL1].[AMOUNT] > 0 AND [SQL1].[AMOUNT] <=50 )ELSE ([SQL1].[AMOUNT] < 0)

Make sure you put this in a filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top