Iif query between 2 numbers

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
764
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I am trying to do an Iif in an Access table to determine how long a person has worked with the team, but I am getting an error "Expression not Supported for conversion" and I have no idea what this means.
Am I missing something basic?

Code:
IIf([Experienced] Between 0 And 90,"0 - 3 Months",IIf([Experienced] Between 90 And 180,"3 - 6 Months", "Experienced"))

thanks in advance
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I know you can use "BETWEEN" in criteria, but I am not sure that you can use it in calculated columns that you want to return.
Try replacing this check:
Rich (BB code):
[Experienced] Between 0 And 90
with something like this instead:
Rich (BB code):
(([Experienced] >= 0) And ([Experienced] < 90))
and repeat that same logic for the other IIF part too.
 
Upvote 0
Solution
The expressions you can put in table field validation are quite limited. I am quite sure that IIF is not one of them. That means while the suggestion seems to be a valid validation expression, it will force number entries to be from 0 to 89 and won't show strings like "0 - 3 Months". To get that, you'll have to validate with a form.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top