473,386 Members | 1,924 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,386 software developers and data experts.

Multiple Criteria for an IIF Statement in Access

I am having trouble with creating an IIF Statement with multiple criteria.

Ultimately I want it to do the following:

Expand|Select|Wrap|Line Numbers
  1. IIF amount<0, 1
  2. IIF amount>=0 and amount <100, 2
  3. IIF amount >=100 and amount <1000, 3
and so on...

Can anyone help?
Oct 19 '11 #1
4 7341
Rabbit
12,516 Expert Mod 8TB
You can nest them together
Expand|Select|Wrap|Line Numbers
  1. iif(expression1, 1, iif(expression2, 2, ... and so on))
Oct 19 '11 #2
Thanks. I tried it, but still got an error. This is what I wrote:

Expand|Select|Wrap|Line Numbers
  1. Update EE_Detail_Tab_1
  2. set STRAT_FIELD=
  3. IIF([VARIN REPCUR]<0), 1,
  4. IIF (([VARIN REPCUR]>=0 and [VARIN REPCUR] <100), 2,
  5. IIF (([VARIN REPCUR] >=100 and [VARIN REPCUR] <1000), 3))
The error I received was "Syntax error in Update Statement"
Oct 19 '11 #3
Rabbit
12,516 Expert Mod 8TB
Your parentheses are out of place and you have spaces between the function name and the opening parentheses.
Oct 19 '11 #4
NeoPa
32,556 Expert Mod 16PB
That's because you haven't nested them properly. Check out your parentheses.

PS. I presume this is SQL code and not VBA. You didn't mention in your question.
Oct 19 '11 #5

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

Similar topics

0
by: Alicia | last post by:
Hello, I need some help with First Criteria statement or DISTINCT. I would like the Par # column to have all distinct or just the first value it encounters. I tried to add the criteria in access,...
4
by: ShyGuy | last post by:
I have a table with 4 fields. Three are used for criteria. I can get the DLookup to work with 1 criteria with the following but can't get it to work with 2 or three. NumofAppts = DLookup("",...
3
by: developing | last post by:
Hello How do I specify multiple criteria for FindFirst or FindRecord (or anything else) that takes the criteria from a form. (text field and number field) edit: this will be in the after...
1
by: 2D Rick | last post by:
I want to open a report using OpenReport and passing it a Where Clause with multiple criteria. I know the Where Clause below is way off but it conveys what I need. Dates are of string type. ...
0
by: ChadK | last post by:
I am trying to open a report based on what the user selects on a form. Each individual criteria works but when I try to combine to pass multiple criteria it doesn't. I have read what I can find on...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
2
by: trinismooth | last post by:
Hi All Trying to do a dcount with multiple criteria for example: =DCount("","access rights"," = 'kev'" and ='Christian Fellowship members temp'" And ='yes'") Thanks for any assistance
1
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
3
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.