Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / September 2005

Tip: Looking for answers? Try searching our database.

Expressions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pompey_Boy - 13 Sep 2005 11:24 GMT
Hi can anyone help with this:

I'm trying to use an IIf Between and And statement to work out
curriculum levels  ie if between 1 and 4 then show '3c' if between 5
and 8 then show '3b' and so on, I've got the first bit working ok, but
if I then and a '+ IIf'and do the next one, I get an error.
Graham R Seach - 13 Sep 2005 12:11 GMT
You can use the IIf(), Choose(), or Switch() functions:

IIf(intNumber >=1 And intNumber <=4, "3c",IIf(intNumber >=5 And intNumber
<=8, "3b", "3a"))

Choose(intNumber,"3c","3c","3c","3c","3b","3b","3b","3b","3a")

Switch(intNumber >=1 And intNumber <=4, "3c",intNumber >=5 And intNumber
<=8, "3b", intNumber >=9, "3a")

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

> Hi can anyone help with this:
>
> I'm trying to use an IIf Between and And statement to work out
> curriculum levels  ie if between 1 and 4 then show '3c' if between 5
> and 8 then show '3b' and so on, I've got the first bit working ok, but
> if I then and a '+ IIf'and do the next one, I get an error.
Gijs Beukenoot - 13 Sep 2005 12:12 GMT
From Pompey_Boy :
> Hi can anyone help with this:
>
> I'm trying to use an IIf Between and And statement to work out
> curriculum levels  ie if between 1 and 4 then show '3c' if between 5
> and 8 then show '3b' and so on, I've got the first bit working ok, but
> if I then and a '+ IIf'and do the next one, I get an error.

Is this wat you mean?
IIF( <currilcumValue> between 1 and 4, "3c", IIF( <curriculumValue>
between 5 and 8, "3b", <FalseValueOrFunction>))
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.