M
mikelee101
Hello,
I'm running into an issue and was hoping someone could help. I have a
query that I'd like to calculate the time between two dates. There
are 3 date fields involved: Received Date, Tasks Complete Date and
Closed Date. If Closed Date exists, then it should calculate Closed
Date - Received Date. If Closed Date is null and Tasks Complete Date
exists, then it should calculate Tasks Complete Date - Received Date.
If both Closed Date and Tasks Complete Date are null, then it should
return "N/A."
Here's what I've got and what it's doing:
Turn Time: IIf(IsNull([tblTransferData]![Closed
Date]),IIf(IsNull([tblTransferData]![Tasks Complete Date]),"N/A",
[tblTransferData]![Tasks Complete Date]-[tblTransferData]![Received
Date]),[tblTransferData]![Closed Date]-[tblTransferData]![Received
Date])
If Closed date is not null, it's calculating correctly.
If Closed date is null and Tasks Complete Date is not null, it's
calculating correctly.
If Closed date and Tasks Complete Date are both null, it's returning
#Error.
If I replace the false instructions in the inner IIf function with a
text expression, it no longer returns an error. Example:
Turn Time: IIf(IsNull([tblTransferData]![Closed
Date]),IIf(IsNull([tblTransferData]![Tasks Complete Date]),"N/A","N/
B"),[tblTransferData]![Closed Date]-[tblTransferData]![Received Date])
If Closed date is not null, it's calculating correctly.
If Closed date is null and Tasks Complete Date is not null, it's
returning N/B (as expected).
If Closed date and Tasks Complete Date are both null, it's returning N/
A (as expected).
I'm at a loss. Is there a limit to the number of calculations that
you can do in a single expression? Or did I make an obvious bracket
v. parenthesis error that I just can't see because I've been staring
at this thing so long?
Access 2000, XP Pro SP2
Thanks to all.
Mike Lee
Coppell, TX, USA
I'm running into an issue and was hoping someone could help. I have a
query that I'd like to calculate the time between two dates. There
are 3 date fields involved: Received Date, Tasks Complete Date and
Closed Date. If Closed Date exists, then it should calculate Closed
Date - Received Date. If Closed Date is null and Tasks Complete Date
exists, then it should calculate Tasks Complete Date - Received Date.
If both Closed Date and Tasks Complete Date are null, then it should
return "N/A."
Here's what I've got and what it's doing:
Turn Time: IIf(IsNull([tblTransferData]![Closed
Date]),IIf(IsNull([tblTransferData]![Tasks Complete Date]),"N/A",
[tblTransferData]![Tasks Complete Date]-[tblTransferData]![Received
Date]),[tblTransferData]![Closed Date]-[tblTransferData]![Received
Date])
If Closed date is not null, it's calculating correctly.
If Closed date is null and Tasks Complete Date is not null, it's
calculating correctly.
If Closed date and Tasks Complete Date are both null, it's returning
#Error.
If I replace the false instructions in the inner IIf function with a
text expression, it no longer returns an error. Example:
Turn Time: IIf(IsNull([tblTransferData]![Closed
Date]),IIf(IsNull([tblTransferData]![Tasks Complete Date]),"N/A","N/
B"),[tblTransferData]![Closed Date]-[tblTransferData]![Received Date])
If Closed date is not null, it's calculating correctly.
If Closed date is null and Tasks Complete Date is not null, it's
returning N/B (as expected).
If Closed date and Tasks Complete Date are both null, it's returning N/
A (as expected).
I'm at a loss. Is there a limit to the number of calculations that
you can do in a single expression? Or did I make an obvious bracket
v. parenthesis error that I just can't see because I've been staring
at this thing so long?
Access 2000, XP Pro SP2
Thanks to all.
Mike Lee
Coppell, TX, USA