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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format CASE in sp

Status
Not open for further replies.

brutus6294

Technical User
Aug 16, 2007
41
US
I'm trying to edit a stored procedure..
I want to add the clause that if doc_type=I or doc_type=C
to perform the below Case statement, but am having problems with an acceptable format... Below is the existing statement. How do I add "or doc_type=C"

case when doc_type = 'I' then sum(amt_1) else 0 end as inv_amount,



Thanks
 
Code:
case when doc_type = 'I' [!]Or doc_type = 'c' [/!]then sum(amt_1) else 0 end as inv_amount,

Or...

Code:
case when [!]doc_type In('I','C')[/!] then sum(amt_1) else 0 end as inv_amount,

-George

"the screen with the little boxes in the window." - Moron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top