Difference of date time

Hi,I have 2 date/time fields.One is to store the date and another is to store the time.How can I find the difference of that date/time with the current date/time in formula language??

The output can be in days/months/hours etc.

Subject: Difference of date time

Date := [1/1/2004]; ← your date fieldTime := [9:00]; ← your time field

(@Now - @TextToTime(@Text(Date) + " " + @Text(time)))/60/60/24;

Subject: RE: Difference of date time

That works fine with date and time constants, but I would be a little careful when applying it to Date/Time fields. The potential issue is, whether a field really just contains a time or a date, or if the other component simply is not displayed. Depending on how the fields were populated, this can easily happen.

However, if you can be sure that the precautions are met, this solution is more simple and elegant, for sure.

Subject: RE: Difference of date time

Not nearly as elegant as using @TimeMerge would be, though.

Subject: RE: Difference of date time

Holy shift, didn’t think of that since doing the update tests for 6!

More importantly, it will even take care of date fields containing a time component and time fields containing a date component on its own.

I keep saying that 6 was the most underrated release ever, now it bites me in my own back …

Subject: Difference of date time

Build a complete date/time value from both fields and subtract that from @Now.

Or just search this forum for an answer.

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/6542d7449c32ff708525735a002f30d8?OpenDocument