UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Query, Access 2016    
 
   
lilus615
post May 31 2020, 11:40 PM
Post#1



Posts: 123
Joined: 6-September 06
From: CA, USA



i need help with this formula im using in a query and im getting error message

Expr3: IIf(IsNull([Decision]),"Submitted not Approved",
IIf([Decision]="Declined","Declined/Withdrawn",
IIf([Decision]="Withdrawn","Declined/Withdrawn",
IIf([Decision]="Approved" and
IIf( IsNull( [COVID19]) , "Approved not Boarded",
IIf( [Decision] ="Approved" and [COVID19] >0, "Approved and Boarded")))))

thank you
Go to the top of the page
 
moke123
post Jun 1 2020, 12:39 AM
Post#2



Posts: 1,390
Joined: 26-December 12
From: Berkshire Mtns.


Whats the error message?

You appear to have a random "and" in the middle of the expression or an IIf that shouldn't be.

CODE
Expr3: IIf(IsNull([Decision]),"Submitted not Approved",
IIf([Decision]="Declined","Declined/Withdrawn",
IIf([Decision]="Withdrawn","Declined/Withdrawn",
IIf([Decision]="Approved" and
IIf( IsNull( [COVID19]) , "Approved not Boarded",
IIf( [Decision] ="Approved" and [COVID19] >0, "Approved and Boarded")))))


try
CODE
Expr3: IIf(IsNull([Decision]),"Submitted not Approved",
IIf([Decision]="Declined","Declined/Withdrawn",
IIf([Decision]="Withdrawn","Declined/Withdrawn",
IIf([Decision]="Approved" and IsNull([COVID19]) , "Approved not Boarded",
IIf( [Decision] ="Approved" and [COVID19] >0, "Approved and Boarded")))))

This post has been edited by moke123: Jun 1 2020, 12:43 AM
Go to the top of the page
 
projecttoday
post Jun 1 2020, 01:57 AM
Post#3


UtterAccess VIP
Posts: 12,387
Joined: 10-February 04
From: South Charleston, WV


Switch funtion.

--------------------
Robert Crouser
Go to the top of the page
 
lilus615
post Jun 1 2020, 02:38 AM
Post#4



Posts: 123
Joined: 6-September 06
From: CA, USA


thank you very much, that worked.
Go to the top of the page
 
projecttoday
post Jun 1 2020, 02:41 AM
Post#5


UtterAccess VIP
Posts: 12,387
Joined: 10-February 04
From: South Charleston, WV


What worked?

--------------------
Robert Crouser
Go to the top of the page
 
lilus615
post Jun 1 2020, 06:18 PM
Post#6



Posts: 123
Joined: 6-September 06
From: CA, USA


sorry, the code provided by moke123 worked.

thank you
Go to the top of the page
 
projecttoday
post Jun 1 2020, 09:25 PM
Post#7


UtterAccess VIP
Posts: 12,387
Joined: 10-February 04
From: South Charleston, WV


Good. You might want to check out the Switch function as a way to simplify the code.

--------------------
Robert Crouser
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    9th July 2020 - 07:05 AM