time difference

   how can I do a time difference between 2 datetimes ?  Below and attached what I have done. When there are 2 different dates it doesn´t work. 
Someone can help me ?

the time datetype only holds values from 00:00 till 23:59, thus a day.
so, you need to fix it a little bit better.

you can store it in a datetime, but you still have issues probably.
my bet is, just create it as an text with hour/minutes and seconds.

Hi Luciano,

What you have will work fine for differences up to 23 hours and 59 minutes...

But if your use case needs to go beyond that, then you must change your output variable to Text and do something like:

DiffHours(InitialDate,FinalDate) + " hour(s)" + Mod(DiffMinutes(InitialDate,FinalDate),60) + " minute(s)"
It depends on how you want to present your data - if you want number of days, seconds, ...

Thank you guys. This solved my problem.