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

Conditional Statement in SP won't work

Status
Not open for further replies.

cisscott

IS-IT--Management
Apr 21, 2003
115
US
Im trying to insert a statement into a stored procedure that will conditionally assign the value of 'Net'.. basically what I want to say is:

(IF eventseat.buyertype LIKE '1%' OR
eventseat.buyertype LIKE '5%' THEN
SELECT((SUM(eventseat.price - 2)) / 1.11475)
ELSE (SELECT SUM(eventseat.price))
AS 'Net'

I've tried this all different ways, but it looks like I cannot use if...then...else in conjunction with Select. Any hints on how to do what Im after? Thanks !
 
Hi,
A Stored Procedure in what database?

It will differ between SqlServer, Oracle , Access, etc..


[profile]
 
Sorry. It was really late when I posted that =). The DB is MS SQL Server.
 
As i recall... been awhile since I have written a SQL server procedure. Case statements work instead of if then else.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top