Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SUM() and CASE together
Message
De
19/03/2009 16:45:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01389763
Message ID:
01389771
Vues:
28
>Hi,
>
>I get error "Incorrect syntax near ')'." If I remove the following line from the SQL Select, the error goes away:
>
>
>"sum( CASE WHEN MYTABLE.REC_ID = '0' THEN MYTABLE.MYFLD ELSE 0.00 ) as ST_HOURS, " 
>
>
>What could be wrong with the above line syntax?

You forgot "end"


sum( CASE WHEN MYTABLE.REC_ID = '0' THEN MYTABLE.MYFLD ELSE 0.00 END ) as ST_HOURS,

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform