Hi,
I have 2 specific "date" columns and I want to know the difference in time between the two, I don't want to consider the actual different days, only the time!
For example, one entry is at 8:00 Am on monday and the other is at 10:00 am on tuesday, I want to calculate only the difference in time to obtain "2 hours" and not "26 hours"
currently I have :
DateDiff(DateInterval.Minute, controleAccessBindingsource.Item(controleAccessBindingsource.Position)("debut"), controleAccessBindingsource.Item(controleAccessBindingsource.Position)("fin")) / 60
but this considers the days as well
Hours = DateDiff( In Minutes, Date1, Date2 ) / 60
The first thing that jumps to mind is to simply do a MOD operation on the result (i.e. what is the remainder after division):
Hours = ( DateDiff( In Minutes, Date1, Date2 ) / 60 ) MOD 24
That will take your value of 26 hours, divide it by 24, and give you the remainder of 2.