BigJohn
16th April 2004, 09:57
Hi,
In Baan V, the dates are stored as date and time.
Here is my problem.
I have 2 date fileds
date1 and date 2
I want to know the difference between the two dates.
for e.g.
date1 = 01/01/2004, 23:00
date2 = 01/02/2004, 1:00

I want the diif to give me 1 day although they are just 2 hours apart.
Basically I want the diff between the two dates while ignoring
the time.

How do I do it?
Please advice.
Thanks.
Cheers,
BigJohn

NPRao
16th April 2004, 10:29
Do use the search engine to look for known solutions before asking your question on the board.

Refer to - Difference between two dates (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=6589&highlight=date+difference)

bdittmar
16th April 2004, 13:52
Hello BigJohn,

use date.to.num for date1 and date2

diffdays = date.to.num(date2) - date.to.num(date1)

regards Bernd

BigJohn
17th April 2004, 19:49
How do I do it for a WHERE clause?

WHERE tisfc001.cmdt inrange :date.f and :date.t and
(tisfc001.cmdt - tisfc001.dldt) >= :form.days

Thanks.

Cheers,
BigJohn