What Does +IIF Do as Opposed to IIF?

What Does +IIF Do as Opposed to IIF?James Igoehttp://code.comparative-advantage.com/
0
james
3/7/2007 4:46:31 PM
access 16762 articles. 2 followers. Follow

5 Replies
503 Views

Similar Articles

[PageSpeed] 13

AFAIK, there's no such function as +IIf in VBA. If I had to guess, I'd say that the + is simply arithmetic: add the results of the IIf function to whatever preceeded it.How are you seeing it used?-- Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele(no e-mails, please!)<james.igoe@gmail.com> wrote in message news:1173285991.823665.303480@p10g2000cwp.googlegroups.com...>> What Does +IIF Do as Opposed to IIF?>> James Igoe> http://code.comparative-advantage.com/> 
0
Douglas
3/7/2007 5:50:29 PM
On 7 Mar 2007 08:46:31 -0800, "james.igoe@gmail.com"<james.igoe@gmail.com> wrote:>>What Does +IIF Do as Opposed to IIF?>>James Igoe>http://code.comparative-advantage.com/Nothing much, other than (perhaps) adding the numeric value returnedby IIF to some other expression. What's the context? Why do you ask?             John W. Vinson [MVP]
0
John
3/7/2007 6:27:35 PM
+IIf(UnmatchedDeals.System<>UMD2.System,"111","999") &+IIf(UMD2.Index>UnmatchedDeals.Index,UMD2.Index,UnmatchedDeals.Index)On Mar 7, 1:27 pm, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>wrote:> On 7 Mar 2007 08:46:31 -0800, "james.i...@gmail.com">> <james.i...@gmail.com> wrote:>> >What Does +IIF Do as Opposed to IIF?>> >James Igoe> >http://code.comparative-advantage.com/>> Nothing much, other than (perhaps) adding the numeric value returned> by IIF to some other expression. What's the context? Why do you ask?>>              John W. Vinson [MVP]
0
james
3/7/2007 6:39:57 PM
Those plus signs would appear to serve no useful purpose.-- Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele(no e-mails, please!)<james.igoe@gmail.com> wrote in message news:1173292797.239325.203620@64g2000cwx.googlegroups.com...>> +IIf(UnmatchedDeals.System<>UMD2.System,"111","999") &> +IIf(UMD2.Index>UnmatchedDeals.Index,UMD2.Index,UnmatchedDeals.Index)>>>> On Mar 7, 1:27 pm, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>> wrote:>> On 7 Mar 2007 08:46:31 -0800, "james.i...@gmail.com">>>> <james.i...@gmail.com> wrote:>>>> >What Does +IIF Do as Opposed to IIF?>>>> >James Igoe>> >http://code.comparative-advantage.com/>>>> Nothing much, other than (perhaps) adding the numeric value returned>> by IIF to some other expression. What's the context? Why do you ask?>>>>              John W. Vinson [MVP]>> 
0
Douglas
3/7/2007 7:07:10 PM
If you're trying to add the values, leave out the ampersand.  The first + sign doesn't seem to be doing anything.  You can also use + as a concatenation operator if you want the concatenation to return Null if any of the values are Null.  For instance:[Address1] & Chr(13) & Chr(10) & ([Address2] + Chr(13) + Chr(10)) & [City]will evaluate this part of the expression to Null if Address2 is null:([Address2] + Chr(13) + Chr(10))If there is no Address2 field, the carriage return and line feed Chr(13) + Chr(10) become part of the null expression within parentheses, and are in effect skipped, which means there won't be an empty space in the address where the Address2 field would be.<james.igoe@gmail.com> wrote in message news:1173292797.239325.203620@64g2000cwx.googlegroups.com...>> +IIf(UnmatchedDeals.System<>UMD2.System,"111","999") &> +IIf(UMD2.Index>UnmatchedDeals.Index,UMD2.Index,UnmatchedDeals.Index)>>>> On Mar 7, 1:27 pm, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>> wrote:>> On 7 Mar 2007 08:46:31 -0800, "james.i...@gmail.com">>>> <james.i...@gmail.com> wrote:>>>> >What Does +IIF Do as Opposed to IIF?>>>> >James Igoe>> >http://code.comparative-advantage.com/>>>> Nothing much, other than (perhaps) adding the numeric value returned>> by IIF to some other expression. What's the context? Why do you ask?>>>>              John W. Vinson [MVP]>> 
0
BruceM
3/7/2007 7:52:01 PM
Reply:

Similar Artilces:

IIF Statement syntax?
I have a timesheet template that allows a user to enter their Time In, Time out for Lunch, Time back In, Time Out for the day, then calculates the time differences to give total number of hours worked. I am trying to make it so that if the total time for the day is Negative, it assigns zero as the default. Here is the statement that I tried IIF(ROUND((((E7-E6)+(E4-E3))*24),2)<0, ROUND((((E7-E6)+(E4-E3))*24),2),0 Can anyone give me some help on what I've done wrong? I just get #NAME in the box Thanks for the help in advance Mac Could it be that IFF should be IF? Bernard "m...

IIF(AND) statement
Hi I have a number of things I need to test in the query. I need to use IIF statement with AND (for example in Excel you can do it),. Example I need this IIf (and(cat="HS",cat2="JTK",cat3="NT"),"1","2") how to do it in access? -- Greatly appreciated Eva On 7 apr, 21:09, Eva <E...@discussions.microsoft.com> wrote: > Hi > I have a number of things I need to test in the query. I need to use IIF > statement with AND (for example in Excel you can do it),. > Example > I need this > IIf (and(cat="H...

iIF clause
Can you help me build the right IIf field in the query with the following conditions : The field DDU consissts of : DDU :[exworks]*2+0,4+0,01 To the above expression i must also add 0,001 if size = 205, etc according to the following table : 205 0.001 60 0.001 20 0.009 1 1.32 4 0,32 0,5 1,67 However Acces does not accept my query, obvioulsy i have errors : DDU : [exworks]*2+0,4+0,01 + IIf([size = 205],0,001,[size = 60],001) Will you help me ? ...

IIF question
Hello. Doing a report that uses an IIF in a textbox that is text. If the IIF is false I would like the text (mainly 1 or 2 words) not to be underlined. How do I end the IIF so the text is not underlined? Thanks. John I am not sure how you mean, but if you want this underlined based on the true or false then use the properties box and choose the text decoration item and write an expression in there. "JohnE" <JohnE@discussions.microsoft.com> wrote in message news:5C6EEFBC-0DC0-41C0-A35D-3A01209E568A@microsoft.com... > Hello. Doing a report that uses an IIF...

What Does +IIF Do as Opposed to IIF?
What Does +IIF Do as Opposed to IIF?James Igoehttp://code.comparative-advantage.com/ AFAIK, there's no such function as +IIf in VBA. If I had to guess, I'd say that the + is simply arithmetic: add the results of the IIf function to whatever preceeded it.How are you seeing it used?-- Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele(no e-mails, please!)<james.igoe@gmail.com> wrote in message news:1173285991.823665.303480@p10g2000cwp.googlegroups.com...>> What Does +IIF Do as Opposed to IIF?>> James Igoe> http://code.comparative-advantage.com/> On 7 Mar 200...

help with nested iif statement
I have a table and I want to create a query that has a new field " Type of Shipment" base on a field "Item Category" If the item category field equals ZDIR, ZTRN ...etc up to 23 different item categories the "Type of Shipment field will equal DIRECT else I would like it to return "Stock" Any help will be greatly appreciated. Thanks Hi, for the iif statement. What you can do is: IIf(category = 'ZDIR' OR category = 'ZTRN' OR .............,'DIRECT','') Having a long nested if is a headache. What i can suggest ...

Sum(IIF statement
I have a large table that I want to query 2 things from. Please be patient because I am pretty new at this. I need to count the number of times that something appears in some fields in the table. Below is what I have tried (keep in mind there are many more fields to count)... test: [Exp1]=Sum(IIf([Account number] Is Not Null,1,0)+(IIf([Address] Is Not Null,1,0)) I would like my output to look like: KEY TEST 1 2 2 0 3 5 etc... And then I want to look in each of those same fields and if there is data concatenate it into one field on the query output and...

IIF with condition
A criteria "<100" in a numeric field is successful. Using it in an IIF statement as IIF(1=1,<100) dosen't work. What is the proper syntax? Dave Dave wrote: > A criteria "<100" in a numeric field is successful. Using it in an IIF > statement as IIF(1=1,<100) dosen't work. What is the proper syntax? > > Dave > What are you trying to do? "<100" in a criteria, for the field [MoneyBet] is saying, give me all records that have a number less than 100, in [MoneyBet]. an iff statement is: iff(criteria, , answer if criteria is...

iif and between
hello i have a set of numbers 1-52 in a field. when i query criteria ...between [weekvar] and [weekvar]-13....i get the answer i need with the query: a set of numbers. However, when i put this same condition within an iif statement in the query criteria, it doesn't work and comes up with no results. iif([weekvar]>13, between [weekvar] and [weekvar]-13, 100). The "100" answer will work, but the "between" will not query anything. What i am trying to do is to return a set of numbers while using iif(. I don't understand why it'll work when...

IIf
I am creating a report that I want to spell out "has expired on" and the date that I entered in the form if that date is prior to today; or to spell out "will expire on" and the date that I entered in the form if that date is greater than today. I used the following: " Furthermore, the waiver of fees that you have received " & IIf([Forms]![frm_rptDrugFeeLtr].[WvrExpDate]<='=GETDATE()',"has expired on ","will expire on ") & [Forms]![frm_rptDrugFeeLtr].[WvrExpDate] & .... When I put the = in front of GETDATE, i...

IIF Statement
Hello, In my Access 2003 database I have the following IIF statement in one of the modules. DoCmd.OpenQuery IIf(ans = vbYes, "qryGetMWF", "qryGetWF") This works fine but I want to change it so that a 2nd query is run in both conditions. If True I want the following 2 queries run. qryGetMWF and qryTrainingDatesMWF If False. qryGetWF and qryTrainingDatesWF How does the IIF statement need to be changed? Thanks. -- Regards, Chris "eckert1961" <eckert1961@discussions.microsoft.com> wrote in message news:F4AB3547-70C8-46AC-89DB-...

iif question
This should be an easy one for you gurus... I a cell, I have a NOW() function that keeps updating everytime a value changes. =IF(F22 = "","",NOW()) Isn't there a way to capture the date/time and "lock it" so that it doesn't change? I'm keeping track of user input date & time values. tia, -- JMorrell Take a look here: http://www.mcgimpsey.com/excel/timestamp.html In article <5FD7764D-9253-423F-A09B-3E2598D89A61@microsoft.com>, "JMorrell" <JMorrell@discussions.microsoft.com> wrote: > This should be an easy o...

Multiple IIf statements
I'm having trouble placing multiple Include If (IIf) statements in a query. There are a number of organisms with full names in our database, I want to pull them but have them all displayed under the most generic of their names. The following statement works fine up until the second IIf. When I add that segment, I get a message saying I there is a syntax error or I have not included enough brackets. Org_1 Change: IIf([Org_1] Like "ESBL*","ESBL",[Org_1]),IIf[Org_1] Like "CR*","Carbapenem",[Org_1]) The mistake is probably obvious, but could so...

IIF statement??
I was going to use Payroll ID numbers as the unique identifier for each person that I enter into a database template that I recently downloaded, but realized on Friday that that may not work as we have some folks to be put into the database who do not have ID numbers. I would like to use IDs for those who have them, and then have the database randomly or sequentially generate them for those that I do not have IDs for. Would an IIF statement be the best way to do this? And if it is, how would I go about doing it? Thank you, Teri. Hi Teri, I'd be more inclined to add...

Help with IIF / DLookup formula
Hello - I am getting an error with this formula: =IIf(NZ(DLookUp([PymtTotal],"q_PymtTotalsBySessionSub","[FamilyID]=" & [Family_ID])),0,(DLookUp([PymtTotal],"q_PymtTotalsBySessionSub","[FamilyID]=" & [Family_ID]))) The error only shows if there is no payment data in the q_PymtTotalsBySessionSub query. If there is data, then the formula returns "0", which is incorrect. This formula works properly if there is payment data, but gives an error if there is none: =DLookUp([PymtTotal],"q_PymtTotalsBySessionSub","[Fami...

IIF
I have a field with yes/no, i would like to send an email if the field = yes, i have done a macro to send the document to a member of staff, but all the time, i want it sent when the field - yes only. Any ideas? Thanks Elaine On Fri, 09 Nov 2007 01:35:58 -0800, Elainie <Elaine.Macintyre@bsc.wales.nhs.uk> wrote: >I have a field with yes/no, i would like to send an email if the field >= yes, i have done a macro to send the document to a member of staff, >but all the time, i want it sent when the field - yes only. Just what are you sending? A report? A programmatically gener...

iif expression and time format
I have a table with a time field that displays a long form time (12:00:00 AM) by default. Through a query I want to build a work shift field for grouping these records. Below is an expression, but I know the time format is wrong. What format do I use? iif(([AccTime]between 6:01 and 18:00), "Day", "Night") -- TDC TDC wrote: >I have a table with a time field that displays a long form time (12:00:00 AM) >by default. Through a query I want to build a work shift field for grouping >these records. Below is an expression, but I know the time format ...

how can I save a file as *.iif
I export my bank transactions to an *iif file. If I import everything I have duplicate checks and other information such as "Imported Income" that I have to change within quickbooks. I'd rather edit the *.iif file and imported a correct one. I cannot seem to import the corrected file. *iif is not one of my "save as" options. txt files won't import. Does anyone have a work around? Do you have the All files (*.*) option? then you can specify your full filename xData.iif PS what is iif? - -Mark "pobruce" wrote: > I export my bank tran...

Two IIF criteria
Hi Here’s my situation where I’d really appreciate some help... If my customer has only one status record (using [JobID] for the count) AND the [JobSubStatus] = “Awaiting Appointment Advice” then I want the # of days to be calculated as: Now()-[datereceived] However if there is more than one status record AND the [JobSubStatus] = “Awaiting Appointment Advice” then I want the # of days to be calculated from the: [JobStatusDate] of the [JobSubStatus] where it equals “Appointment Scheduled” - [datereceived] Note – this criteria is part of a bigger IIF statement ...

IIf then
I have an unbound text box in a report where I want to do a simple calculation. IIf [UnitCount] has data then [UnitSize]/[UnitCount] IIf [SubUnitCount] has data then [UnitSize]/[UnitCount] I can't seem to get the syntax right. Any help would be appreciated. THANKS! -- www.Marzetti.com Try something like this: =IIf([UnitCount] <> 0, [UnitSize] / [UnitCount], Null) That avoids the division by zero error. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org....

IIF for any
Hi, I'm looking for a way to restate this: =IIf([Fall]="1","Yes","No") so that if ANY listing for Fall is 1, then it will return a "Yes" value. Is there a better way to do this? It's being used in a report based off a query. (Ideally, I'd like to update the base table with this info to make it easier/eliminate this function, but the person with the knowledge isn't available, and it would be a LOT of work for her.) Thanks in advance! = CBOOL(DCount("*", "tableNameHere", "Fall=1)) should do. I assumed Fall h...

IIF Function in query
Hello all, I have a table which I have the default value 0, If these a way to use the function "IIF" in query to keep the cell blank when the cell contain a 0 as the default value? Because, if there is no quanity entered, I don't want to see the default value in my report Thanking you for your help! Fred's That sort of begs the question "Why have a default value if you don't want it?" IIf([Field] = 0, Null, [Field]) To remove the unwanted 0s, you can write an Update query: UPDATE MyTable SET MyField = Null WHERE MyField = 0 Of course, what happens if so...

IIf works in query but not in report
Does the IIf function work differently in queries from the way it works in reports? For example, this works in a query: lastName: IIf([Last]="Smith",Null,([Last])) (I can hid the last name "Smith" in the lastName field.) However, I cannot use the same IIf as a control source in a report. It generates a circular reference error message. = IIf([Last]="Smith",Null,([Last])) (If the name is not "Smith", then print it.) Is this just how IIf works? ...

IIf function
In my tblAddresses table I have a lookup field called TypeofAddress (Business, Delivery, Home, Mailing…) I am trying to tell it to display only one type out of the bunch: TypeofAddress 1. If TypeofAddress is not equaled to 1 then display TypeofAddress 2 and so on. I created a query using tblAddresses. The Criteria for TypeofAddress is: IIf([TypeofAddressID]=1,[TypeofAddressID],[TypeofAddressID]=2 Xor ([Address].[TypeofAddressID])=3 Xor ([Address].[TypeofAddressID])=7 Xor ([Address].[TypeofAddressID])=8 Xor ([Address].[...

IIf AND
Greetings All, I have a query with these 2 expressions: Expr2: IIf([Pregnant?]="Yes","1","0") Expr3: (IIf([IVDrugUser?]=True,"1","0")) For the report I'm trying to create, I need to know how many [Pregnant?]=Yes" are ALSO [IVDrugUser]=True." In other words, where both expressions return "1" How do I get there from here? Do I make another expression in the query? Do I put an exprerssion in the control on the report? Thanks in advance!!! Access Neophyte "AccessNeophyte" <liznewhome@yahoo.com> wrote...