SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates,...


=IIF(Fields!urgency_level.Value = 2 and Fields!DateDifference.Value <=2, Fields!NeedUrgentDates, 1) Errors, but does not give me an error code

Author
Message
Gillian_Pappas2002
Gillian_Pappas2002
SSC Eights!
SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)

Group: General Forum Members
Points: 904 Visits: 124
=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.
@SQLFRNDZ
@SQLFRNDZ
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5161 Visits: 1228
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

Gillian_Pappas2002
Gillian_Pappas2002
SSC Eights!
SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)

Group: General Forum Members
Points: 904 Visits: 124
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.
sturner
sturner
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12439 Visits: 3276
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.
Gillian_Pappas2002
Gillian_Pappas2002
SSC Eights!
SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)SSC Eights! (904 reputation)

Group: General Forum Members
Points: 904 Visits: 124
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)
anthony.green
anthony.green
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62620 Visits: 8597
IIF is used in SSRS, while it is not a valid T-SQL construct is is a valid Reporting Services construct



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
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search