Joining IIF statements together

S

Sue Compelling

Hi

I have the following two IIF statements which give the right results when
used separately but I need to join them together so Access is assessing all
conditions. I've tried multiple ways though come back with varied errors -
from syntax, commas, too many arguments etc ...

Is there actually a way I can join these?

=IIf([JobSubStatus]="Awaiting Appointment Advice" And
DCount([JobID],"QryInProgress","[JobID] = " &
[JobID])=1,Now()-[datereceived],[JobStatusDate]-[datereceived])

=IIf(IsNull([JobSubStatus]),Now()-[datereceived],IIf([jobsubstatus]="Awaiting
Customer" Or "Appointment
Scheduled",[jobstatusdate]-[datereceived],[JobStatusDate]-[dateappt]))


TIA ...
 
J

John Spencer

=IIf(([JobSubStatus]="Awaiting Appointment Advice"
And DCount("*","QryInProgress","JobID=" & [JobID])=1)
OR IsNull(JobSubStatus)
, Date()-[datereceived]
,IIf([JobSubStatus] = "Awaiting Customer"
or [JobSubStatus]= "Appointment Scheduled"
,[JobStatusDate]-[datereceived],[JobStatusDate]-[dateappt]))


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
S

Sue Compelling

Thanks so much John - it worked AND you showed me how I should make the
statement better - so I was able to add in some more logic.

Brilliant ...

Wildcard here - my "Notify me of replies" NEVER works. It used to though
stopped about 3 mths ago - anything different that you know of?
--
Sue Compelling


John Spencer said:
=IIf(([JobSubStatus]="Awaiting Appointment Advice"
And DCount("*","QryInProgress","JobID=" & [JobID])=1)
OR IsNull(JobSubStatus)
, Date()-[datereceived]
,IIf([JobSubStatus] = "Awaiting Customer"
or [JobSubStatus]= "Appointment Scheduled"
,[JobStatusDate]-[datereceived],[JobStatusDate]-[dateappt]))


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Sue said:
Hi

I have the following two IIF statements which give the right results when
used separately but I need to join them together so Access is assessing all
conditions. I've tried multiple ways though come back with varied errors -
from syntax, commas, too many arguments etc ...

Is there actually a way I can join these?

=IIf([JobSubStatus]="Awaiting Appointment Advice" And
DCount([JobID],"QryInProgress","[JobID] = " &
[JobID])=1,Now()-[datereceived],[JobStatusDate]-[datereceived])

=IIf(IsNull([JobSubStatus]),Now()-[datereceived],IIf([jobsubstatus]="Awaiting
Customer" Or "Appointment
Scheduled",[jobstatusdate]-[datereceived],[JobStatusDate]-[dateappt]))


TIA ...
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Two IIF criteria 1

Top