On Wed, 6 Apr 2005 08:53:05 -0700, Harrison Ten <Harrison
I am trying to calculat the following expression but an error message
expression has two many arguments. the calculation is as follows: Weekly
hours:iif([hours worked]>#11:30#,+[hours exceeded]+[allocated hours],[hours
worked]<#11:30#,+[hours saved]+[allocated hours])
The IIF function has three arguments: you're giving it four.
The first argument is a logical expression which evaluates to either
TRUE or FALSE.
The second argument will be returned if the first argument is TRUE.
The third argument will be returned if the first argument is FALSE.
I think what you want is
Weekly hours: IIf([hours worked]>#11:30#, [hours exceeded]+[allocated
hours], [hours saved]+[allocated hours])
Note though that if [Hours worked] is a Date/Time field, that you may
not get the results you expect. Date/Time values are good for storing
points in time, but less good for storing durations. You may want to
restructure your query to store durations in long integer minutes.
John W. Vinson[MVP]
Thank you John that was a great help.