Problem in negative value when convertin to hours

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
'====================================================
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top