Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Per kg rate
Message
 
 
À
14/11/2016 05:21:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01643341
Message ID:
01643350
Vues:
122
This message has been marked as the solution to the initial question of the thread.
Looks like your SQL Server version is 2008 R2 and I believe IIF function was added in SQL 2012.

Change this line to use CASE statement instead, e.g.
round(sum(amount) / case when sum(weight) = 0 then null else sum(weight) end, 2) as KgRt
>Thanks
>
>SQLSERVER Version is
>
>SQL Server Configuration Manager
>Microsoft Corporation
>Version: 2009.0100.4000.00
>
>
>Microsoft SQL Server Management Studio 10.50.4000.0
>Microsoft Data Access Components (MDAC) 6.1.7601.17514
>Microsoft MSXML 3.0 6.0
>Microsoft Internet Explorer 8.0.7601.17514
>Microsoft .NET Framework 2.0.50727.5420
>Operating System 6.1.7601
>
>I am using your command in Management studio
>
>this line also does not work
>
round(sum(amount)/iif(sum(weight)=0, null, sum(weight))),2) as kgrt
>
>Msg 102, Level 15, State 1, Line 2
>Incorrect syntax near '='.
>Msg 156, Level 15, State 1, Line 9
>Incorrect syntax near the keyword 'as'.
>
>
>I am using sqlserver for VFP and PHP
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform