﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » SQL Server 2005 query that uses the IIF with style date bool ?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 19 May 2026 22:03:51 GMT</lastBuildDate><ttl>20</ttl><item><title>SQL Server 2005 query that uses the IIF with style date bool ?</title><link>http://forum.strataframe.net/FindPost33323.aspx</link><description>&lt;div&gt;Suppose I have TABLE with the following fields:&lt;div&gt;Quantity [number]&lt;div&gt;Price [Number]&lt;div&gt;Returns [bool]&lt;br/&gt;&lt;br/&gt;&lt;div&gt;If Returns = true, then - ([quantity]*[Price])// negative returns&lt;div&gt;If Returns = false, then ([quantity]*[Price]) // positive returns&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Question using SQL Server 2005:&lt;div&gt;Inquiry following his error was in command IIF:&lt;div&gt;[CODE]&lt;div&gt;SELECT quantity, Price, Returns, IIF ([Returns] = 0, ([quantity]*[Price]), (-1)*([quantity]*[Price])) As Total&lt;div&gt;FROM TABLE;&lt;div&gt;[/CODE]&lt;br/&gt;&lt;br/&gt;&lt;div&gt;SQL Syntax Errors Encountered:&lt;div&gt;The following errors were encountered while parsing the contents of the SQL pane:&lt;div&gt;Error in list of function arguments: '=' not recognized. Unable to parse query text.</description><pubDate>Sun, 12 Jun 2016 21:21:25 GMT</pubDate><dc:creator>Dong Trien Lam</dc:creator></item><item><title>RE: SQL Server 2005 query that uses the IIF with style date bool ?</title><link>http://forum.strataframe.net/FindPost33325.aspx</link><description>Ok, thank you</description><pubDate>Sun, 12 Jun 2016 21:21:25 GMT</pubDate><dc:creator>Dong Trien Lam</dc:creator></item><item><title>RE: SQL Server 2005 query that uses the IIF with style date bool ?</title><link>http://forum.strataframe.net/FindPost33324.aspx</link><description>&lt;br/&gt;&lt;br/&gt;That IIF statement only exists in MDX - the query language for SQL Server Analysis Services - the datawarehousing side of SQL Server.&lt;br/&gt;&lt;br/&gt;Plain T-SQL does not have an IIF statement.&lt;br/&gt;&lt;br/&gt;The best you can do in T-SQL is use the CASE.... WHEN... THEN... statement.</description><pubDate>Sun, 12 Jun 2016 08:44:43 GMT</pubDate><dc:creator>Yasar Askari</dc:creator></item></channel></rss>