Problem in negative value when convertin to hours

M

Marco

Hi.

when I converting a negative value to hours sometimes the convertion is a
wrong.

If I have -2.5 that means -2:30h, it converts to -3:30h, but if I have -8,
it converts to -8:00h

I'm using this querie:
TotalHorasLiquidaGozar: Int([TotalHorasGozar]) &
Format([TotalHorasGozar]/24;":nn")


How can I solve this?

Regards,
Marco
 
J

John Spencer

Try using Fix instead of Int.

Look up the two functions in the VBA help to see the difference in the
results they return with negative numbers.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
M

Marco

Thanks: :) it works

John Spencer said:
Try using Fix instead of Int.

Look up the two functions in the VBA help to see the difference in the
results they return with negative numbers.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Hi.

when I converting a negative value to hours sometimes the convertion is a
wrong.

If I have -2.5 that means -2:30h, it converts to -3:30h, but if I have -8,
it converts to -8:00h

I'm using this querie:
TotalHorasLiquidaGozar: Int([TotalHorasGozar]) &
Format([TotalHorasGozar]/24;":nn")


How can I solve this?

Regards,
Marco
 
Top