TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dong Lam Trien
830
986
147.6k
SQL Server 2005 query that uses the IIF with style date bool
Jun 12 2016 4:40 AM
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.
Reply
Answers (
2
)
Assigning object reference to interface variable why?
How to clear the error in update query