Dear All,
I am experiencing a problem with an IIF statement in Access. As I have never created one of these before I am having real problems getting my head around them. What I am trying to do is write an IIf statement that will bring out only information that I require and because I am asking for several things to be done there is a conflict somewhere and it just is not working.
The statement I am using is below. The fields that I am using are "Cycle" and "Comment", but there are others, but not knowing which line or field to put this information in I am at a loss. Could some kind person please point me in the right direction as to how I would link a number of different fields and criteria.
=IIF([cycle]="02" and [comment]="RFC11878"))
6 2541
Is this in a query, Controlsource, or VBA?
I am asking for several reasons, anyhow your statement addresses the criteria but you left out the part to show that the criteria is met or not: - =IIF([cycle]="02" and [comment]="RFC11878","ThenDoThis","OtherwiseDoThis")
-
The following can be replaced with field names and even calculations[ThenDoThis] + [ThenDoThis] or as a constant such as what I showed.
"ThenDoThis"
"OtherwiseDoThis"
I am still not awake yet need more coffee. I reread your title and if you need to nest them then it might look more like the following: -
=IIF([cycle]="02" and [comment]="RFC11878",IIF(1=1,1,2),IIF(2=2,2,1))
-
FAO Denburt,
Sorry If I din't make it clear. I am actually trying to do this on the query itself. What I am trying to do is to produce a report and if the records do not match the criteria then I don't want them counting in my query. Hope this helps.
So you are saying that you are buiding criteria for a field that will show results if the criteria is met -
MyNewFieldName:IIF([cycle]="02" and [comment]="RFC11878",IIF(1=1,1,2),IIF(2=2,2,1))
-
or are you actually trying to create criteria to remove the records you don't want(looking at it in SQL view it would be a where or having statement depending if your query has totals): -
Where [cycle]="02" and [comment]="RFC11878"
-
Chris
If you give us the logic in English of what you are trying to do with your query we will be beter able to help.
Mary
Or if not in English, at least in American! ;0)>
Sign in to post your reply or Sign up for a free account.
Similar topics
by: d2r2 |
last post by:
Hi,
I'm trying to run a nested (UNION) query against a MSAccessXP database
(version 2002; build 10.6501.6714; SP3)
In Access the SQL-statement executes just fine. When I run it in a asp-page
I...
|
by: Tcs |
last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't
loaded it yet. I'm still using MS Access. And no, I don't believe this is an
Access question. (But who knows? I...
|
by: PeterZ |
last post by:
Hi,
Back to basics!
My understanding is that the only way to exit a For-Next loop prematurely is
with the 'break' keyword. How are you supposed to do that if you're inside
a Switch...
|
by: ECathell |
last post by:
I had read an article at one time that suggested a pattern to get around deeply nested if..then..else hell...
Can anyone point me in that direction?
select case statements wont work for me in...
|
by: John Sidney-Woollett |
last post by:
Is it possible to use the dblink and dblink_exec features from inside
pl/pgsql functions to mimic the behaviour of nested transactions by
calling another function or executing some SQL via the...
|
by: Tim N. van der Leeuw |
last post by:
Hi,
The following might be documented somewhere, but it hit me unexpectedly
and I couldn't exactly find this in the manual either.
Problem is, that I cannot use augmented assignment operators...
|
by: Josiah Manson |
last post by:
I found that I was repeating the same couple of lines over and over in
a function and decided to split those lines into a nested function
after copying one too many minor changes all over. The only...
|
by: =?Utf-8?B?QUEyZTcyRQ==?= |
last post by:
Could someone give me a simple example of nested scope in C#, please?
I've searched Google for this but have not come up with anything that makes
it clear. I am looking at the ECMA guide and...
|
by: Gabriel Rossetti |
last post by:
Hello,
I can't get getattr() to return nested functions, I tried this :
.... def titi():
.... pass
.... f = getattr(toto, "titi")
.... print str(f)
....
Traceback...
|
by: brasse |
last post by:
Hello!
I have been running in to some problems when using
contextlib.nested(). My problem arises when using code similar to
this:
from __future__ import with_statement
from contextlib...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |