473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Access IIF not working

I am trying to do a multiple Iif function in Access 2002 but it needs to check multiple fields and doesn't seem to get past the first set in the Iif.

Expand|Select|Wrap|Line Numbers
  1. IIf(([DATADUMP1-10].[Edition 1] Is Not Null And [DATADUMP1-10].[Status 1] Is Not Null) Or ([DATADUMP1-10].[Edition 1] Not Like "PN" And [DATADUMP1-10].[Status 1] Not Like "S") Or([DATADUMP1-10].[Edition 2] Not Like "PN" And [DATADUMP1-10].[Status 2] Not Like "S") Or ([DATADUMP1-10].[Edition 3] Not Like "PN" And [DATADUMP1-10].[Status 3] Not Like "S") Or ([DATADUMP1-10].[Edition 4] Not Like "PN" And [DATADUMP1-10].[Status 4] Not Like "S") Or ([DATADUMP1-10].[Edition 5] Not Like "PN" And [DATADUMP1-10].[Status 5] Not Like "S") Or ([DATADUMP1-10].[Edition 6] Not Like "PN" And [DATADUMP1-10].[Status 6] Not Like "S") Or ([DATADUMP1-10].[Edition 7] Not Like "PN" And [DATADUMP1-10].[Status 7] Not Like "S") Or ([DATADUMP1-10].[Edition 8] Not Like "PN" And [DATADUMP1-10].[Status 8] Not Like "S") Or ([DATADUMP1-10].[Edition 9] Not Like "PN" And [DATADUMP1-10].[Status 9] Not Like "S") Or ([DATADUMP1-10].[Edition 10] Not Like "PN" And [DATADUMP1-10].[Status 10] Not Like "S"),"Subscriber","NonSubscriber") AS Expr1, 
Any help would be appreciated. I realize this is older but that is what they have me using.
Nov 18 '10 #1
6 1413
NeoPa
32,556 Expert Mod 16PB
Agivler:
and doesn't seem to get past the first set in the Iif.
What on Earth do you mean by this? What does "not getting past" even mean?

What actually happens? What error message do you get? What makes you think there is a problem at all? What points you to there being a problem in the first set? What is a set even?

If you give us a question that makes sense I expect we can help you, but not from this I'm afraid.
Nov 18 '10 #2
Sorr I am viewing each part of the Iif as a set. So it seems to give me the correct data when it goes through this part
Expand|Select|Wrap|Line Numbers
  1. IIf(([DATADUMP1-10].[Edition 1] Is Null And [DATADUMP1-10].[Status 1] Is Null) Or ([DATADUMP1-10].[Edition 1] Not Like "PN" And [DATADUMP1-10].[Status 1] Not Like "S")
but then it seems to skip
Expand|Select|Wrap|Line Numbers
  1. Or ([DATADUMP1-10].[Edition 2] Not Like "PN" And [DATADUMP1-10].[Status 2] Not Like "S") Or ([DATADUMP1-10].[Edition 3] Not Like "PN" And [DATADUMP1-10].[Status 3] Not Like "S") Or ([DATADUMP1-10].[Edition 4] Not Like "PN" And [DATADUMP1-10].[Status 4] Not Like "S") Or ([DATADUMP1-10].[Edition 5] Not Like "PN" And [DATADUMP1-10].[Status 5] Not Like "S") Or ([DATADUMP1-10].[Edition 6] Not Like "PN" And [DATADUMP1-10].[Status 6] Not Like "S") Or ([DATADUMP1-10].[Edition 7] Not Like "PN" And [DATADUMP1-10].[Status 7] Not Like "S") Or ([DATADUMP1-10].[Edition 8] Not Like "PN" And [DATADUMP1-10].[Status 8] Not Like "S") Or ([DATADUMP1-10].[Edition 9] Not Like "PN" And [DATADUMP1-10].[Status 9] Not Like "S") Or ([DATADUMP1-10].[Edition 10] Not Like "PN" And [DATADUMP1-10].[Status 10] Not Like "S"),"NonSubscriber","Subscriber")
Nov 18 '10 #3
NeoPa
32,556 Expert Mod 16PB
Agivler:
I am viewing each part of the Iif as a set.
As I have no idea what uou mean by part or set this is still pretty unhelpful. If I told you I was separating the SQL up into distinct blobs, would that mean anything to you? I expect not. Communication is like that. If you use words that have no defined meaning within a context then I won't understand what you're trying to say.

You then go on to repeat yourself. Pretty unhelpful when I still don't understand what you're trying to say.

To help the situation, and bring some understanding into the question I asked specific questions. This means that even if your communication skills are very poor, all you would need to do to progress would be to answer the questions that I ask. Unfortunately you seem to have ignored them completely.

I really can't help you if you ignore what I say. Whether I want to or not (and I generally like to help where I can) I simply can't help you if I have no idea what you're talking about.
Nov 18 '10 #4
No blobs don't mean anything to me. I have just been thrown into using Access and not fimilar with all the correct terminology. Let me try this.

I need to search for a null field and then also search through Edition 1 (thru 10) and Status 1 (thru 10). Yes, I know there has to be a better way then search through 10 fields each but that is the way they have the data and it can't be changed.

This part of the statement seems to work and return the correct result
Expand|Select|Wrap|Line Numbers
  1. IIf(([DATADUMP1-10].[Edition 1] Is Null And [DATADUMP1-10].[Status 1] Is Null) Or ([DATADUMP1-10].[Edition 1] Not Like "PN" And [DATADUMP1-10].[Status 1] Not Like "S")
but when I add on the following it just seems to ignore it
Expand|Select|Wrap|Line Numbers
  1. Or ([DATADUMP1-10].[Edition 2] Not Like "PN" And [DATADUMP1-10].[Status 2] Not Like "S") Or ([DATADUMP1-10].[Edition 3] Not Like "PN" And [DATADUMP1-10].[Status 3] Not Like "S") Or ([DATADUMP1-10].[Edition 4] Not Like "PN" And [DATADUMP1-10].[Status 4] Not Like "S") Or ([DATADUMP1-10].[Edition 5] Not Like "PN" And [DATADUMP1-10].[Status 5] Not Like "S") Or ([DATADUMP1-10].[Edition 6] Not Like "PN" And [DATADUMP1-10].[Status 6] Not Like "S") Or ([DATADUMP1-10].[Edition 7] Not Like "PN" And [DATADUMP1-10].[Status 7] Not Like "S") Or ([DATADUMP1-10].[Edition 8] Not Like "PN" And [DATADUMP1-10].[Status 8] Not Like "S") Or ([DATADUMP1-10].[Edition 9] Not Like "PN" And [DATADUMP1-10].[Status 9] Not Like "S") Or ([DATADUMP1-10].[Edition 10] Not Like "PN" And [DATADUMP1-10].[Status 10] Not Like "S"),"NonSubscriber","Subscriber") AS Expr1,
Unfortunately I need to check all these fields but am wondering if it is too much for Access 2002 to handle.
Nov 18 '10 #5
NeoPa
32,556 Expert Mod 16PB
Agiv:
No blobs don't mean anything to me.
Of course they don't. No more do parts or sets mean anything to me, or anybody else for that matter, unless and until you clarify what you mean by answering my questions.
Agiv:
Let me try this.
You're welcome to try that, but I should tell you that until you start answering my questions I will completely ignore anything you post. It's only basic courtesy after all. That and putting the CODE tags around your code as I've commented on for each of your posts so far.
Nov 18 '10 #6
JKing
1,206 Expert 1GB
In your if statement you are using multiple ORs. If just one of those conditions evaluates to true the entire if statement returns true.

If you need all conditions to be met then you would need to use AND not OR.
Nov 19 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Mark DuPrey | last post by:
I've got a script in an ASP page that is supposed to extract certain files from a zip file, move them, create a new zip with the moved files and then make a self-extracting archive out of the new...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
28
by: Neil Ginsberg | last post by:
I have a client who is using Access 2002/2000 (the database itself is written in 2000), and is considering migrating to Access 2003. Any recommendations on whether Access 2003 is worth the migrate,...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
2
by: Frav | last post by:
The Reps team have been experiencing that Access 2002 unexpectedly quits while working and also lots of Corruption Failures and "Record lock can not update" messages since the upgrade from...
10
by: rcnews | last post by:
Hi, First timer here. Where's the best place to educate myself on how to use PHP in conjunction with Microsoft Access--good online tutorials, sites, blogs, etc...? I work at a small online...
7
by: clintonG | last post by:
To all Microsoft partners and customers who have been unable to download recently or access ASP.NET documentation from the msdn2 website and for all of those customers who have been lied to and...
0
by: TravelingCat | last post by:
Hi, My program contains events, each event has several assignments (displayed on the same form, in a subform). Each assignment has a checkbox, it's checked to send mail to "assignInCharge" to...
0
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...
0
isladogs
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.