Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
=IIF(Fields!urgency_level.Value = 2 and...
=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1) Errors, but does not give me an error code
Rate Topic
Display Mode
Topic Options
Author
Message
Gillian_Pappas2002
Gillian_Pappas2002
Posted Monday, January 07, 2013 12:33 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, January 30, 2013 9:20 AM
Points: 3,
Visits: 7
=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1)
gives me "Error" on output, but there are no error codes. The syntax checks out and the values for
fields urgency_level and DateDifference are numeric data.
Post #1403815
@SQLFRNDZ
@SQLFRNDZ
Posted Monday, January 07, 2013 12:43 PM
SSC-Addicted
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 12:03 PM
Points: 412,
Visits: 862
Gillian_Pappas2002 (1/7/2013)
=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1)
gives me "Error" on output, but there are no error codes. The syntax checks out and the values for
fields urgency_level and DateDifference are numeric data.
obviously it errors with your posted query .. need more info and full query you are trying and I see IIF what is it ? do you mean IF
--
SQLFRNDZ
Post #1403821
Gillian_Pappas2002
Gillian_Pappas2002
Posted Monday, January 07, 2013 12:51 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, January 30, 2013 9:20 AM
Points: 3,
Visits: 7
That is the formula that I added to Visual Studio 2008 calculated formula
=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1)
Input field Urgency_level can = 1 - 4, and the Field DateDifference can = 0-100, in the above Fx formula
in Visual Studio I and trying to get the calculated field NeedUrgentDates to be true, if the urgency_level = 2
and the DateDifference is less than or equal to 2.
Thanks for your input.
Post #1403828
sturner
sturner
Posted Monday, January 07, 2013 1:43 PM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 12:33 PM
Points: 1,315,
Visits: 2,887
IIF() is a microsoft Access construct. That won't work with SQL Server.
Look into the CASE statement instead.
The probability of survival is inversely proportional to the angle of arrival.
Post #1403862
Gillian_Pappas2002
Gillian_Pappas2002
Posted Monday, January 07, 2013 2:40 PM
Forum Newbie
Group: General Forum Members
Last Login: Wednesday, January 30, 2013 9:20 AM
Points: 3,
Visits: 7
Thanks for your help......I got it to work....
=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2 and Fields!KeptAppointments.Value = 1, 1,0)
Post #1403879
anthony.green
anthony.green
Posted Tuesday, January 08, 2013 1:04 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
IIF is used in SSRS, while it is not a valid T-SQL construct is is a valid Reporting Services construct
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1404026
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.