I would like to Substract one date from another using dao.recodset and get format "dd hh:mm:ss"
My fields in table e.g.
strDate = 17.10.2016 08:17:45
endDate = 18.10.2016 09:23:36
the problem is, if trying rst!endDate - rst!strDate then result is "31 01:05:31" I tried various combination e.g.
And always got wrong value:/
What's wrong in my code? How to get correct result?
My fields in table e.g.
strDate = 17.10.2016 08:17:45
endDate = 18.10.2016 09:23:36
the problem is, if trying rst!endDate - rst!strDate then result is "31 01:05:31" I tried various combination e.g.
Code:
Format(rst!endDate - rst!strdate, "DD hh:mm:ss")
Code:
Format(CDate(Format(rst!endDate, "yyyy-mm-dd hh:mm:ss")) - CDate(Format(rst!strdate, "yyyy-mm-dd hh:mm:ss")), "dd hh:mm:dd")
And always got wrong value:/
What's wrong in my code? How to get correct result?