I
Incolor
Hi All,
I have the following statement in a query.
8HRTWA:
CDbl(Nz([RESULT]*[TIME_MINUTES]/IIf([TIME_MINUTES]<=15,15,IIf([LIMIT_TYPE]
In ("TLV","PEL") And [TIME_MINUTES]>15,480,IIf([LIMIT_TYPE]="REL" And
[TIME_MINUTES]>15,600,IIf([LIMIT_TYPE]="CEILING" And
[TIME_MINUTES]>15,nz([RESULT])))))))
It is sort of working. It is still including the [time_minutes] that
are less than 15 where I state that the [time_minutes] should be >15.
Any idea what I am doing wrong?
This is what the statement should be doing:
If the [time_minutes] is less than 15 the formula is result*time
minutes/15
If the [time_minutes] is >15 AND the limit type is TLV or PEL the
formula is result*time minutes/480
If the [time_minutes] is >15 AND the limit type is REL the formula is
result*time minutes/600
If the [time_minutes] is >15 AND the limit type is CEILING then there
is no formula; 8HRTWA is the Result.
I hope it makes sense. Any guidance would be greatly appreciated!
MV
I have the following statement in a query.
8HRTWA:
CDbl(Nz([RESULT]*[TIME_MINUTES]/IIf([TIME_MINUTES]<=15,15,IIf([LIMIT_TYPE]
In ("TLV","PEL") And [TIME_MINUTES]>15,480,IIf([LIMIT_TYPE]="REL" And
[TIME_MINUTES]>15,600,IIf([LIMIT_TYPE]="CEILING" And
[TIME_MINUTES]>15,nz([RESULT])))))))
It is sort of working. It is still including the [time_minutes] that
are less than 15 where I state that the [time_minutes] should be >15.
Any idea what I am doing wrong?
This is what the statement should be doing:
If the [time_minutes] is less than 15 the formula is result*time
minutes/15
If the [time_minutes] is >15 AND the limit type is TLV or PEL the
formula is result*time minutes/480
If the [time_minutes] is >15 AND the limit type is REL the formula is
result*time minutes/600
If the [time_minutes] is >15 AND the limit type is CEILING then there
is no formula; 8HRTWA is the Result.
I hope it makes sense. Any guidance would be greatly appreciated!
MV