Hi guys, need help with the iif in query, i need to display these adjectival rating using the equivalents from a different query, i would like to use iif:
100-90 = Outstanding
89-80 = Very Satisfactory
79-50 = satisfactory
49-30 = unsatisfactory
29 below = poor
I've actually tried this: - Adjectival_Rating:IIF([eval]<=100 And [eval]>=90,“Outstanding”, (IIF([eval]<=89 And [eval]>=80, “Very Satisfactory” , (IIF([eval]<=79 And [eval]>=50, “Satisfactory”, (IIF([eval]<=49 And [eval]>=30, “Unsatisfactory”, (IIF([eval]<=29, “Poor”,”Out of Range”)))))))))
But I can't seem to find what's wrong :| please help
4 2286
haha, finally got it :)
Just have to use the value "eval" and drag it in the FIELD to identify where the value will be coming from. - AdjectivalRating: IIf([eval]<=100 And [eval]>=90,"Outstanding",(IIf([eval]<=89 And [eval]>=80,"Very Satisfactory",(IIf([eval]<=79 And [eval]>=50,"Satisfactory",(IIf([eval]<=49 And [eval]>=30,"Unsatisfactory",(IIf([eval]<=29,"Poor","Out of Range")))))))))
NeoPa 32,556
Expert Mod 16PB
Using IIf() can be less involved than that, but frankly an even better solution, as it's available, would be to use Switch() : - AdjectivalRating: Switch([Eval] Between 90 And 100,'Outstanding',
-
[Eval]>=80,'Very Satisfactory',
-
[Eval]>=50,'Satisfactory',
-
[Eval]>=30,'Unsatisfactory',
-
[Eval] Between 0 And 29,'Poor',
-
True,'Out of Range')
NB. This is laid out to view. You would enter it into your query as a single item.
Or, based on your data: - IIf([eval] <= 29, "Poor", _
-
IIf([eval] <= 49, "unsatisfactory", _
-
IIf([eval] <= 79, "satisfactory", _
-
IIf([eval] <= 89, "Very Satisfactory", _
-
"Outstanding"))))
See NeoPa's NB too. NeoPa
I think that you must use the Between() function also in lines 2-4. Wreckx
Note that NeoPa's solution is very general for problems like yours.
My solution is specific based on your data ranges (no gaps between ranges)
NeoPa 32,556
Expert Mod 16PB NeoPa:
Using IIf() can be less involved than that, but frankly an even better solution, as it's available, would be to use Switch()
I did say that it's possible to create a better version using IIf(), but I wouldn't recommend it as Switch() is better in all respects. Your suggestion is not a match for the question as it assumes (as the original question does not) that values outside of the range 0 <= X <= 100 are not possible. They need to be catered for in the scenario described by the question. Mihail: NeoPa
I think that you must use the Between() function also in lines 2-4.
No. That wouldn't be a solution I could recommend, but it does draw my attention to a very real flaw in my logic. With that in mind here's a new version which (hopefully) reflects the logic correctly : - AdjectivalRating: Switch([Eval] Not Between 0 And 100,'Out of Range',
-
[Eval]<30,'Poor',
-
[Eval]<50,'Unsatisfactory',
-
[Eval]<80,'Satisfactory',
-
[Eval]<90,'Very Satisfactory',
-
True,'Outstanding')
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brad Burke |
last post by:
From a windows .Net app, I need to 1) check if MSAccess is already open to a
certain Access application. If so, then open a form and find a certain
record. 2) If not open, then open MSAccess and...
|
by: (Pete Cresswell) |
last post by:
I've got a .BAT file that I use for executing various MS Access apps that I
wrote way back in the days of 2.0.
It's evolved over time, but it still contains a number of possible paths to...
|
by: Richard Beacroft |
last post by:
Trying to write a C# Windows App to export all objects and content from
2 MSAccess 97 databases for comparison analysis.
very little documentation found.
Have managed to instantiate MSAccess,...
|
by: Annick Van Hoof |
last post by:
Hi,
I'm having my ASP.NET application hosted at a Windows 2003 server (IIS6).
This works almost all the time (I have uptimes of 100% on most days), but
then all of a sudden a few days in a row I...
|
by: Keith H. |
last post by:
I found a post on this problem from 2004, but no one at that time
replied to it- I'm hoping to have better luck than the original author!
As the subject states, I'm running into a problem where...
|
by: MLH |
last post by:
I've been unable to determine the correct setting
to force a copy of msaccess.exe to be written to
target disk during runtime installation process. It
may be that the runtime installation...
|
by: reidarT |
last post by:
I am making an installation program for an Access application. The
application is run on both Office 2000, 2002, 2003 and soon 2007 versions of
Office,
When I install the application I need a...
|
by: rolandsk |
last post by:
I need help to schedule a MsAccess procedure I want the procedure to run in backgrund and not the MsAccess file to be open during the time when the procedure runs. The procedure in MsAccess picks...
|
by: dsdevonsomer |
last post by:
Hello,
I have one simple query joining two tables with left outer join on 3
fields and using MIN on two fields. These two tables have lot of data
about 3 mil in total. I am trying to migrate db...
|
by: bbrewder |
last post by:
I am struggling with some MSAccess automation issues. Basically, we
have a .Net application that uses MSAccess for reporting (legacy
code). We are able to launch MSAccess fine and even work with...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |