Skip to main content

Find the difference in total hours based on two Date fields [solved]

  • July 9, 2018
  • 2 replies
  • 32 views

Kim_Trager1
Forum|alt.badge.img+23

I thought this should be straight forward, but somehow it’s creating problems.
I have 2 date fields.
One to track what date and time work is started the other tracks time and date the work has finished.
Based on those to fields I need to find out how many hours is totally billable.

Though I could just minus the two - but I always seem to either get an #error or NaN

Anyone who can point me in the right direction?

2 replies

Forum|alt.badge.img+17

DATETIME_DIFF() works for me:

I’ve used 'hour' as the unit, but maybe you should use minutes and convert to hours to be able to bill the minutes too. I get NaN when a Date is not filled, ¿maybe there is your problem? You could check if there are the dates with IF() to avoid that.


Kim_Trager1
Forum|alt.badge.img+23
  • Author
  • Brainy
  • July 11, 2018

DATETIME_DIFF() works for me:

I’ve used 'hour' as the unit, but maybe you should use minutes and convert to hours to be able to bill the minutes too. I get NaN when a Date is not filled, ¿maybe there is your problem? You could check if there are the dates with IF() to avoid that.


Thank you that works