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 / June 2005

Tip: Looking for answers? Try searching our database.

IIf function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dogwood - 30 Jun 2005 16:26 GMT
The error message I get is that my IIf statement is too complicated.  I am
trying to calculate leadtime demand.  I want it to find a specific number in
one field and then return a value from another.  

LT_Tot_Dmd:
IIf([lead_timeR]=1,[tdmd1],IIf([lead_timeR]=2,[LT2],IIf([lead_timeR]=3,[LT3],IIf([lead_timeR]=4,[LT4],IIf([lead_timeR]=5,[LT5],IIf([lead_timeR]=6,[LT6],IIf([lead_timeR]=7,[LT7],IIf([lead_timeR]=8,[LT8],IIf([lead_timeR]=9,[LT9],IIf([lead_timeR]=10,[LT10],IIf([lead_timeR]=11,[LT11],IIf([lead_timeR]=12,[LT12],IIf([lead_timeR]=13,[LT13],IIf([lead_timeR]=14,[LT14],IIf([lead_timeR]=15,
[LT15] ,IIf([lead_timeR]=16, [LT16] ,IIf([lead_timeR]=17, [LT17]
,IIf[lead_timeR]=18, [LT18] ,IIf([lead_timeR]=19, [LT19]
,IIf([lead_timeR]=20, [LT20] ,IIf([lead_timeR]=21, [LT21]
,IIf([lead_timeR]=22, [LT22] )))))))))))))))))
Duane Hookom - 30 Jun 2005 16:54 GMT
It looks like you have created a spreadsheet type table rather than a
relational database. If this is the case, I wouldn't spend too much time on
it until it was fixed.

However, it looks like all your values are simple incrementing numbers.
Consider using the Choose() function:
LT_Tot_Dmd: Choose([lead_timeR], [tdmd1], [LT2], [LT3], [LT4], [LT5], [LT6],
[LT7], [LT8], [LT9], [LT10], [LT11], [LT12], [LT13], [LT14],
[LT15], [LT16],  [LT17], [LT18], [LT19], [LT20], [LT21],  [LT22] )

Signature

Duane Hookom
MS Access MVP

> The error message I get is that my IIf statement is too complicated.  I am
> trying to calculate leadtime demand.  I want it to find a specific number
[quoted text clipped - 7 lines]
> ,IIf([lead_timeR]=20, [LT20] ,IIf([lead_timeR]=21, [LT21]
> ,IIf([lead_timeR]=22, [LT22] )))))))))))))))))
Dogwood - 30 Jun 2005 18:31 GMT
It worked.  Thanks for the help.

> It looks like you have created a spreadsheet type table rather than a
> relational database. If this is the case, I wouldn't spend too much time on
[quoted text clipped - 17 lines]
> > ,IIf([lead_timeR]=20, [LT20] ,IIf([lead_timeR]=21, [LT21]
> > ,IIf([lead_timeR]=22, [LT22] )))))))))))))))))
Ken Snell [MVP] - 30 Jun 2005 16:57 GMT
Check out the Choose function. It's a perfect fit for this type of
expression. It's in Help file.

Signature

       Ken Snell
<MS ACCESS MVP>

> The error message I get is that my IIf statement is too complicated.  I am
> trying to calculate leadtime demand.  I want it to find a specific number
[quoted text clipped - 7 lines]
> ,IIf([lead_timeR]=20, [LT20] ,IIf([lead_timeR]=21, [LT21]
> ,IIf([lead_timeR]=22, [LT22] )))))))))))))))))
 
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.