# SQL Server 2005 query that uses the IIF with style date bool ? • ### Question

• Suppose I have TABLE with the following fields:
Quantity [number]
Price [Number]
Returns [bool]

If Returns = true, then - ([quantity]*[Price])// negative returns
If Returns = false, then ([quantity]*[Price]) // positive returns

Question using SQL Server 2005:
Inquiry following his error was in command IIF:
[CODE]
SELECT quantity, Price, Returns, IIF ([Returns] = 0, ([quantity]*[Price]), (-1)*([quantity]*[Price])) As Total
FROM TABLE;
[/CODE]

SQL Syntax Errors Encountered:
The following errors were encountered while parsing the contents of the SQL pane:
Error in list of function arguments: '=' not recognized. Unable to parse query text.
Sunday, June 12, 2016 8:43 AM
{"ft_lang_label":"__label__en","ft_lang_prob":0.8463447,"math_prob":0.6088013,"size":877,"snap":"2021-43-2021-49","text_gpt3_token_len":206,"char_repetition_ratio":0.1305842,"word_repetition_ratio":0.0,"special_character_ratio":0.25199544,"punctuation_ratio":0.13071896,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9779553,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-27T04:22:45Z\",\"WARC-Record-ID\":\"<urn:uuid:f7375266-8e0f-4729-805c-fc46083ce2ad>\",\"Content-Length\":\"44697\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d5e4cab6-a579-44e1-96bd-3d44467026a9>\",\"WARC-Concurrent-To\":\"<urn:uuid:72f920dc-3c50-454d-bd3d-3e44b799eacc>\",\"WARC-IP-Address\":\"23.10.82.253\",\"WARC-Target-URI\":\"https://social.microsoft.com/Forums/en-US/9217d5d7-e440-4a34-b27f-f493f51644a5/sql-server-2005-query-that-uses-the-iif-with-style-date-bool-?forum=whatforum\",\"WARC-Payload-Digest\":\"sha1:SQTXZQZND6V5SH6WGST4RUATAYTGW43M\",\"WARC-Block-Digest\":\"sha1:IC4UXSIAUYP5JJAMMCP7HJP3GD7TG7UG\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964358078.2_warc_CC-MAIN-20211127013935-20211127043935-00602.warc.gz\"}"}