Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem With CASE
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Problem With CASE
Divers
Thread ID:
01328265
Message ID:
01328265
Vues:
55
I'm getting "Incorrect syntax near the keyword 'THEN'.". Anyone know what I'm doing wriong here?
SELECT *,
	CASE 

	WHEN PAY_REC = 'REC' AND (NOTSHIP > CASH_BAL OR (NOTSHIP < CASH_BAL AND CASH_BAL > 0)
		THEN CASH_BAL - NOTSHIP
		ELSE 0

	WHEN PAY_REC = 'PAY' AND (NOTSHIP > CASH_BAL OR (NOTSHIP < CASH_BAL AND CASH_BAL > 0)
		THEN CASH_BAL
		ELSE 0

	END AS Ar

FROM Trades
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform