462 questions
2
votes
4
answers
167
views
Can we do an assignment operation in the true/false part of IIF in VB.net?
Can we do an assignment operation in either true or false parts of the IIF function of VB.net?
Public Sub Main(args() As string)
Dim score As Integer = 0
DIM scoreString As String = &...
-3
votes
1
answer
94
views
Access IIF statement to choose values from multiple tables
I have 3 Access 2010 tables cont, cond and prop.
All tables have 3 fields: table cont the key ID_cont
and the fields cond_ID and prop_ID that are related
to the keys ID_cond and ID_prop of cond and ...
0
votes
1
answer
57
views
Access report across three tables
I'm trying to run a report in Access with values from three tables (there are more fields in the actual tables I'm working with but they aren't relevant to this question:
tblUsers
UserID (pk)
LName
...
1
vote
0
answers
25
views
SSAS Cube measure IIF issue
I am working on creating a new cube measure QTD, in an SSAS cube.
The requirement is to display the Measure YTD directly when the current month is January, February, or March (Q1). The initial code I ...
1
vote
1
answer
38
views
jooq iif or nvl2 in request
I can’t figure out what I’m specifying incorrectly, null values from the STUDENT.CURRENT_CURS_ID column are not processed by iif or nvl2 and in general this student with a null value is not included ...
4
votes
2
answers
484
views
Replacement for VBA IIF function
I am working on an Excel project that involves converting an large set of Excel 4.0 macrosheet functions to VBA. These functions make extensive use of the worksheet IF(condition,ifTrue,ifFalse) ...
0
votes
0
answers
64
views
Access query IIF statement not displaying result
This should be a simple one but I have so far been unsuccessful. In access query, I am using the expression builder within a query to pull information from a table.
FirstName: IIf(Len([tbl_Associate].[...
0
votes
0
answers
31
views
SQL Query not includes valid result in Left Join with Where Not Equal To [duplicate]
I have a SQL query which does not perform as expected and returns incomplete results. In the query below, valid t1 rows are not included in the query results if there are no matching ids in t2.
Select ...
0
votes
1
answer
124
views
Aggregating Members calculated with IIF / CurrentMember conditions
An MDX newbie here.
I am trying to define and aggregate a custom measure which contains an IIF condition.
Suppose, for this data model:
Category
Name
ItemType
Price
CatA
Item1
Normal
4.0
CatA
Item2
...
0
votes
1
answer
135
views
Access VBA SQL statement received syntax error when attempting to INSERT values
I'm using Access VBA to insert values into a table based on information from a form. The SQL statement is throwing a syntax error, however, if I pull the SQL into the query builder it will run so I'm ...
0
votes
0
answers
70
views
How do I properly include an IIF Statement in a Dynamic SQL Statement without getting an Error
The code I have below was working, it was creating more code that created code that set-up the extended properties for a given table. But we wanted to start pulling pre-existing column descriptions ...
0
votes
1
answer
200
views
SSRS IIF Statement With Nested IIFs
I am trying to convert numeric months to text in SSRS Report Builder. I am having trouble with the expression needed to make this work. Here is the expression I have:
=IIF(Fields!MonthYear.Value = 6, &...
1
vote
1
answer
182
views
Custom Field in Query for MS Access Issue
I am trying to put a custom field in a query. My other 2 have come off without a hitch, but I cannot for the life of me figure out what I am missing to get this one to work. I've tried dozens of ...
-2
votes
1
answer
42
views
Visual Studio function IIF
I use Visual Studio 2017, and I have an expression like this:
=Microsoft.VisualBasic.Strings.Trim(Fields!QUESTION.Value) &
" Average:" &
ROUND(AVG(fields!...
0
votes
1
answer
148
views
Expression within IIF in Microsoft Access Expression Builder
I want to perform a calculation if the value in a particular field is greater than zero. Specifically, if the value in Field 1 > 0, I want to calculate the percent total from Fields 2 and 3. (Note ...
0
votes
1
answer
94
views
SQL Server using IIF in Where Clause Syntax Error
I'm using SQL Server 2014. I keep getting a red squiggly lines under the last = sign and last parenthesis:
DECLARE @I_sYear char(4);
SET @I_sYear = '2021'
SELECT
PriceType,
SUM(PriceAmount) ...
0
votes
0
answers
36
views
Using Lookup IIF in conditional Formatting
I need to highlight the dates that are in another dataset, this date is 90 days from a renewal date, ive used IIF(LOOKUP, but getting nowhere, this is what i have used
=iif(
LOOKUP(Fields!PERSON_ID....
0
votes
2
answers
53
views
SQL Limit digits limit dash and characters to the right, but if NO dash still show the field data
I'm using this in a SQL query in SQL Server Management Studio, so that if the column dbo.Material_Trans.Lot has a dash the dash and all the string to the right is removed.
SUBSTRING(dbo.Material_Trans....
1
vote
0
answers
55
views
ACCESS SQL IIf Statement doesn't include SUM
I've an IIf-Statement as a new Column Vergleich, which should compare the column Summe_Teile_SAB and Import_Einzelstueckliste.Bedarfsmenge. But I can't include the column Summe_Teile_SAB in the IIf ...
0
votes
1
answer
1k
views
My visibility condition in SSRS caused "[BC30516] Overload resolution failed because no accessible 'IIf' accepts this number of arguments." error
I am using the following expression for a row visibility rule:
=IIF(Sum(Fields!bt_actual_usage.Value) > 0
AND (Count(Fields!bt_actual_usage.Value) < Parameters!Consecutive.Value)), true, false)
...
3
votes
1
answer
64
views
SumIIF Access Query
I am struggling to get the desired results i need using an Access query, and was wondering if what i was looking to do was actually achievable in one query, or whether i would need two queries and ...
0
votes
0
answers
33
views
How to update the value of a cell (e.g. cell D112) in access based on a comparison of the value of B112 to the values of all the cells above B112?
I'm trying to find a way to detect and label duplicate companies in a table. Say the company name is in column B. When ACME company is entered for the second (up to infinity) time in the table, I want ...
0
votes
1
answer
72
views
SSRS Report - IIF statement syntax question
In a tablix - we wish to fill a column textbox (background) with "Yellow" if a threshold is not met. Here is the expression
=IIF((Fields!TotalMonths.Value-Fields!TotalReversalMonths.Value)&...
1
vote
1
answer
61
views
This simple date query does not give me any results if on the date in question
IIf(Weekday(Date()+1)=6,Between Date()+1 And Date()+3,Date()+1)
I need to use this criteria in a query to filter out dates.
At the end of each day this criteria runs to bring up what bookings are to ...
1
vote
1
answer
1k
views
Should I use CASE WHEN or IIF? Are subqueries a possible part of the solution?
I'm using My SQL (latest version) and I have the following table:
CREATE TABLE COURSES (
IDCOURSE INT PRIMARY KEY AUTO_INCREMENT,
NAME VARCHAR (30) NOT NULL,
HOURS INT,
PRICE FLOAT (10,2) NOT NULL,
...
0
votes
1
answer
747
views
Javascript 'iif' equivalent for variable assignment
In javascript, how do you declare a variable and set its value to the result of a function in a single line?
In pseudo-code, what I am trying to achieve is this:
var coinToss = if(Math.random() < 0....
0
votes
1
answer
8k
views
IIF statements with Multiple conditions in SSRS Expression
My expression is different than the ones I looked at already. MY code looks like this and I am having a hard time logically reading it. The code works but is part of another larger IIF statement ...
0
votes
1
answer
777
views
Access Search Query Criteria : IF false return all records
I am trying to use a form to search in a database. One of those forms contains a date.
If The user types in a date, it will only return results from that specific date.
But, if no date is entered, I ...
0
votes
1
answer
162
views
Multiple IIFs and CHARINDEXs searches to extract data from same column in SQL?
This is MS SQL Server 2017.
This currently works. I just can't believe that this is the best way to perform these actions.
The Meeting table is populated from multiple services. It has a ...
-1
votes
1
answer
974
views
SQL Server using IIF resulted AS column in another IIF [duplicate]
on SQL Server 2012+ I am attempting to use IIF resulted column into another IIF as shown in SQL query below but it is gives me error invalid column. Count table has columns CountId and CountedQty,
...
0
votes
1
answer
644
views
MS Access IIF Query if Date
I'm trying to create an access query based on the date field, the query i Have which runs but doesn't populate the correct information is as follows
IIf([Last Pyt Date]>DateAdd("d",-60,...
0
votes
0
answers
104
views
SQLite IFF to change results returns
I'm querying a table with a column that has 5 possible values (1111A, 2222B, 3333C, 4444D, 5555E), I would like to rename those results as part of my query so for each of my results, result should be ...
1
vote
2
answers
800
views
RXJS conditionally call observable
const observable$ = iif(() => this.shippingTabModified,
//Shipping Tab Modified True
of(this.updateShippingInfo())
.pipe(),
//IF Shipping Tab Not Modified
of(...
0
votes
1
answer
884
views
SSRS conditional date selection expression
I have a sql ssrs report which takes data based on selected date range.
There's 2 date parameters:
date from
date till
I need the date from and date till to fill in automatically based on which date ...
-3
votes
1
answer
174
views
Leetcode SQL 1440. Evaluate Boolean Expression
Table Variables:
Column Name
Type
name
varchar
value
int
name is the primary key for this table.
This table contains the stored variables and their values.
Table Expressions:
Column Name
Type
...
5
votes
1
answer
338
views
Multiple dimensions conditions in SSAS MDX query not working
I Am having the following data in my SSAS cube.
My need is to get the value of the measure based on two conditions with two different dimensions using the MDX.
In this example data, I need to get the ...
-1
votes
1
answer
58
views
issue with IFF and Multiple cascading Split in SSRS report
I am getting error for the below,
=IIF(Fields!ParentObjectType.Value !="Approval Request",Split(Split(Fields!CT_CaptionURL.Value,"f =").GetValue(1),"Target").GetValue(0),...
0
votes
0
answers
843
views
SSRS SUM and IIF statement based on Group
I have a dataset "dsAuditQuestions" which has fields including "Category" and "SuccessCriteriaMet". The latter contains either a "True" or "False" ...
0
votes
2
answers
862
views
MS Access IIf Function
I have a calculated field on a table at MS Access and I'd like to use the following syntax, but it returns a syntax error pop-up and and I'm wondering which part is wrong. Could you please help with ...
0
votes
1
answer
120
views
Access/sql ifnull or none [closed]
i am working with two columns. in one column (placement ward) there are some blanks. When there are blanks i want to pull the values in another column (all committs), when it is not blank i want to ...
0
votes
0
answers
715
views
Why is my IIF expression in my RDLC report giving me an #Error
We have an RDLC report that needs to perform a calculation based on two values but before we do the calculation we want to check that the divisor is NOT zero. This is our expression:
=IIF(Fields!...
1
vote
2
answers
331
views
SSRS Nested IIF statements in expression throwing error
I keep getting an error [, is invalid. InvalidSyntax] when deploying this report in Visual Studio. I can't find the incorrect [ , ], also not sure if the bracets are positioned correctly. I am pretty ...
-3
votes
1
answer
107
views
Why does this conversion to date fail on some rows in my table and not other rows when I use an IIF
I have this table and data:
CREATE TABLE dbo.tBadDate
(
BadDateID int NOT NULL,
StartDate nchar(20) NULL,
CONSTRAINT [PK_tBadDate] PRIMARY KEY CLUSTERED
(
[BadDateID] ASC
)
);
...
0
votes
1
answer
9k
views
IIf And statement with multiple conditions
I'm very new to Access.
I'd like to make a column which has two conditions to result in "1" or "0".
The two conditions are:
If the session ID is smaller than 154 AND their level ...
1
vote
2
answers
87
views
Case when in MS Access
I am trying to identify some rows using IIF and Not IN operator but I get syntax error. I want to identify the rows where none of the column contain A1 and A2 using the below query. I don't get the ...
0
votes
1
answer
65
views
IIF Microsoft Access Statement Error Help - Multiple IIF Statements in one query
hoping someone can help me.
I'm trying to run this query, but i get the below error. I need to build logic, based on different fields in different tables then write that data to a new field in a table....
0
votes
1
answer
188
views
SQL IIF Statement Inside WHERE
I am attempting to return a list of items based on a selection of attributes that may or may not be selected. These attributes are listed in a separate table (ItemAttributeMap) by themselves and are ...
0
votes
2
answers
158
views
Where is the Syntax Error in this MS Access Nested IIF with Parameters Query?
I am trying to create a query in Access that sums the number of Projects Under Consideration and Development as a Month End Inventory. There are three fields I need to get that number dtCreate, ...
-1
votes
2
answers
150
views
SQL to R transition on a query
So I need to transition a query from SQL to R and it just so happens that there are limited functions that can be available in R i think.
SQL:
if object_id ('tempdb..#ProductCodingChanges') is not ...
0
votes
1
answer
750
views
Access, multiple iif functions in one
I am trying to come up with a new iif statement to have different logic, however I am getting 0's in my new table when I see records from 1 - Master that should have a balance.
If 1 - Master = 1234 ...