Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Per kg rate
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01643341
Message ID:
01643352
Views:
105
Likes (1)
round(sum(amount) / NULLIF(sum(weight),0), 2) as KgRt
MartinaJ

>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
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform