Awkward calculation

Tay

likes garlic
Local time
Today, 22:41
Joined
May 24, 2002
Messages
269
Hopefully I'm posting in the right place.

I need to create a report with a tricky calculation and I just can't figure out how to do it. Whatever I have tried doesn't seem to encounter all of the null values.
Here is the scenario.....
The report will be used to monitor how well a scheme went.
I have these fields.
Start Target
Revised Start Target
Start Actual
Finish Target
Revised Finish Target
Finish Actual
I need to calulate how long the scheme actually took in working days and how long it was supposed to take in working days. Once I have these figures, I then need to calculate the percentage longer the scheme took, ONLY if it took 2 days longer than it was supposed to.
My main problem is the amount of null values that there can be. Any or all of the fields could be null. Then I have to combat the problem of getting a figure if the scheme took 2 days longer than it should.
Has anyone done anything similar to this, or are any of you able to point me in the right direction as to what I should do?
Many thanks.
 
For the null values, instead of using, say [Finish Actual] in an expression, use Nz([Finish Actual],0).

(Look at the VB help for the Nz function.)

For the conditionals, check the Iif function.
 
Thank you for your replies - I always seem to forget about the Nz function.
 
Tay said:
I always seem to forget about the Nz function.

Code:
If Nz(TaysMemory, "?") = "?" Then
    MsgBox "Uh oh!", vbCritical, "Houston, we have a problem..."
    Beep
Else
   MsgBox "How's is this possible?", vbQuestion, "Curiouser and curiouser"
End If
 
Yet another helpful comment, Mile:rolleyes: :)
 

Users who are viewing this thread

Back
Top Bottom