ks_ks_
11th April 2007, 08:25
Hi,
I want to calculate the difference between 2 dates and that difference has to be in days.
I took the difference of 2 dates and divide it by (24*60*60), but it is giving me the result in thousand, whereas the actual difference is only 3-4 days.
Please help me to fix this.
Thanks,
Beginer
george7a
11th April 2007, 11:16
Hi,
In what format is your input?
Check the following related threads:
http://www.baanboard.com/baanboard/showthread.php?t=9544&highlight=difference+dates
http://www.baanboard.com/baanboard/showthread.php?t=6589&highlight=difference+dates
http://www.baanboard.com/baanboard/showthread.php?t=15055&highlight=difference+dates
I hope it helps,
- George
bigjack
11th April 2007, 11:19
Hi,
I assume the dates you are using are in UTC format. In this case you can use utc.to.local function to get no. of days and then subtract the days directly.
For e.g.,
utc.to.local(utc1 , days1 , time1) and
utc.to.local(utc2 , days2 , time2)
days2 - days1 will give the difference between two dates in days.
Actually your approach should also work, but its difficult to identify problem w/o script.
Cya
baansavvy
18th May 2010, 17:28
Hi,
I assume the dates you are using are in UTC format. In this case you can use utc.to.local function to get no. of days and then subtract the days directly.
For e.g.,
utc.to.local(utc1 , days1 , time1) and
utc.to.local(utc2 , days2 , time2)
days2 - days1 will give the difference between two dates in days.
Actually your approach should also work, but its difficult to identify problem w/o script.
Cya
I tried the above functions but at the compile time it asking me to enter 4 arguements .
BaanInOhio
18th May 2010, 19:07
I tried the above functions but at the compile time it asking me to enter 4 arguements .
http://www.baanboard.com/baanboard/showthread.php?t=50785
See my explanation in the 2nd post down. I assume you are running Baan IV if you need the four arguments. The call with with more arguments in much of the Baan documentation is for Baan V +.