Hi,
The following code works well in a text box controle in detail section of a report:
IIf([StrM]>[EndM],IIf([StrH]>[EndH],(((24*([EndDate]-[StrDate]))-(([StrH]-[EndH]))-1)),(24*([EndDate]-[StrDate]))+(([EndH]-[StrH]))-1) & "." & (60-([StrM]-[EndM])),IIf([StrH]<[EndH],(((24*([EndDate]-[StrDate]))+([EndH]-[StrH]))),(24*([EndDate]-[StrDate]))-([StrH]-[EndH])) & "." & ([EndM]-[StrM]))
But when this column is totalled using expression given below:
=Sum(IIf([StrM]>[EndM],IIf([StrH]>[EndH],(((24*([EndDate]-[StrDate]))-(([StrH]-[EndH]))-1)),(24*([EndDate]-[StrDate]))+(([EndH]-[StrH]))-1) & "." & (60-([StrM]-[EndM])),IIf([StrH]<[EndH],(((24*([EndDate]-[StrDate]))+([EndH]-[StrH]))),(24*([EndDate]-[StrDate]))-([StrH]-[EndH])) & "." & ([EndM]-[StrM])))
it gives error #error.
Please help me out. I could not solve this problem for the last 2 weeks.
Best regards,
Tahir