If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Joining IIF statements together
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 ... -- Sue Compelling |
#2
|
|||
|
|||
Joining IIF statements together
=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 Compelling wrote: 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 ... |
#3
|
|||
|
|||
Joining IIF statements together
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" wrote: =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 Compelling wrote: 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 ... . |
Thread Tools | |
Display Modes | |
|
|