Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1) Errors, but does not give me an error code Expand / Collapse
Author
Message
Posted Monday, January 7, 2013 12:33 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 13, 2014 11:02 AM
Points: 56, Visits: 94
=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
Posted Monday, January 7, 2013 12:43 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, August 31, 2014 1:00 AM
Points: 464, Visits: 1,036
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
Posted Monday, January 7, 2013 12:51 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 13, 2014 11:02 AM
Points: 56, Visits: 94
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
Posted Monday, January 7, 2013 1:43 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 21, 2014 1:54 PM
Points: 1,432, Visits: 3,229
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
Posted Monday, January 7, 2013 2:40 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 13, 2014 11:02 AM
Points: 56, Visits: 94
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
Posted Tuesday, January 8, 2013 1:04 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 2:20 AM
Points: 5,231, Visits: 5,106
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 »

Add to briefcase

Permissions Expand / Collapse