Questions tagged [iif-function]

IIf is a language function to perform an immediate or inline conditional assignment.

IIf is an abbreviation variously for Inline If or Immediate If and is available in many programming and script languages, IIf is implemented as a Function which means it returns a value. In code, these typically take the form:

result = IIf(condition, TruePart, FalsePart)

The value of result afterwards depends on the evaluation of condition.

A multi-line If block could perform the same action but would be an If Statement. The statement form could include any number of other actions such as invoke other methods. On the other hand, IIf simply results in a conditional assignment and cannot invoke other code.

Some languages also support a 'conditional operator', sometimes called a ternary operator, which works similar to IIf, but may offer other benefits.

94 questions
0
votes
1 answer

Writing Dynamic IF Functions by user entry

I'm still pretty new with coding(C#) and am writing a file reader based on user criteria(What string they want to search). What my program does: The user can enter search a sting / multiple strings (with AND OR functionality) The program interprets…
0
votes
1 answer

using IIF in msaccess report

I currently have this formula in my report =(Sum([Final]*[Units]))/Sum([Units])) Final - Mostly Integer but has the NG mixed in the records Units - Integer Re-Exam - Contains Integer Now, with my current formula, if [Final] encounters the value NG,…
0
votes
0 answers

Only Perform Group By When Combo Box is Not Empty

I've solved this problem before. Unfortunately, I'm having the hardest time remembering my solution. I have three combo boxes, one of which (Quarter) the user can choose to leave empty. All three combo boxes are attached to fields in a query. Each…
Mario
  • 1
  • 1
0
votes
0 answers

Colspan and Rowspan MediaWiki if function table

I´d like to know how I can use colspan and rowspan in media wiki if-functions, in a template? The colspan or rowspan shouldn´t be conditional.
0
votes
1 answer

checking whether field in table has space or comma - MS-Access

I have table called FinalForgotten which only contains one field called aname. The field could either look like Smith John or Smith,John. So both last and first name are in same field and delimited by either space or comma. The defense field…
JohnMerlino
  • 3,900
  • 4
  • 57
  • 89
0
votes
2 answers

How do i write an algorithm that reads three numbers and prints them out in ascending order in python

How do i write an algorithm that reads three numbers and prints them out in ascending order in python. Please help this is what i have tried so far i hope you guys can help me out thank you, this is using python and i am new to programming. I do not…
david
  • 183
  • 1
  • 2
  • 7
0
votes
1 answer

IIf function inside Access query

I have a query and I would like to use an IIf function as part of the criteria. Here is the full SQL: SELECT Hits.HitID, Hits.ListingID, Hits.HitCount, Hits.HitDate, Hits.HitTypeID, Hits.IsDeleted FROM Hits WHERE…
Sesame
  • 3,370
  • 18
  • 50
  • 75
0
votes
1 answer

SSRS IIF statement behaving strangely

I have a chart data to be displayed and SSRS is behaving in the strangest way possible. To explain things, I have a bar chart and a line chart in a single chart area. The line chart is where the issue is. To understand this, below is the exact data…
Sujeet Sinha
  • 2,417
  • 2
  • 18
  • 27
0
votes
1 answer

Wrong Result of IIF function in MDX

I have written a query as mentioned below: WITH SET [kpi_study] AS {[study].[study].[BHC June12]} SET [geographic] AS {[territory.market_hierarchy].[state].[HP]} SET [brand] AS {[brand.brand_hierarchy].[brand].[Gold Flake…
sam140
  • 219
  • 1
  • 5
  • 27
0
votes
4 answers

Why won't this work as an IIF function, but will as an IF Statement?

The following works: If 1=1 rdoYes.checked = True Else rdoNo.checked = True End If However, the following doesn't work: IIF(1=1, rdoYes.checked = True, rdoNo.checked = True) Why is this? Thanks!
Curtis
  • 101,612
  • 66
  • 270
  • 352
0
votes
3 answers

Multiple Havings not working

I have a database with the following schema: ID PositionId LeagueId 1 4 5 3 4 5 3 8 5 4 1 6 I have this sql query in Access: SELECT lp.PositionId FROM Leagues l INNER…
Kris B
  • 3,436
  • 9
  • 64
  • 106
0
votes
2 answers

SSRS 2008: iif IsNan statement Error wrong number of arguments

when I run the SSRS report with the following expression below, I get an error that says: wrong number of arguments. I get this error at the ).IsNaN, part of my statement. I don't see what i'm missing. Can anyone please help? =iif( ( …
Maxie
  • 21
  • 1
  • 5
0
votes
1 answer

Angularjs routing not working with controller and model using IIF funtion

I created a simple website with a configuration for routes. I am using IIF javascript for my modules and controllers but routing is not working. It only works if I type the default localhost like this http://localhost:18689 but if try…
Devsined
  • 3,363
  • 6
  • 30
  • 48
0
votes
1 answer

How can I use a case statement with a Drop Box? Access Database

I have a drop box with various items when the value is set to null I want to select multiple items using the control parameter to fill the data source like below. This Select Command will not work can anyone help me to see what I'm doing in error?…
0
votes
1 answer

IIF Function in Access query that adds three fields together and compares answer to another field

I'm using Windows Access 2010. I'm trying to run an IIF Function, using Expression Builder, in a query on one table that asks the query to add three fields together and compare the answer to a fourth field. If the sum of the three fields are equal…