Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I having trouble in getting difference between two dates which is timestamp. I want the difference in "Days" and create a chart.
Example:-
Field 1 :- 4/11/2013 12:40:32
Field 2 :- 4/16/2013 12:00:00
The value should be "5 days"
Try this:
date((date(Field1,'MM/DD/YYY')-date(Field2,'MM/DD/YYYY')),'DD')
HTH
Sushil
HI ,
Try the below code
fabs(Date(Field1,'DD/MM/YYYY')) - fabs(Date(Field2,'DD/MM/YYYY'))
//Yusuf
Hi,
Try this in script
date(timestamp#(date2,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY') as Dt2,
date(timestamp#(date1,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY') as Dt1,
Interval( (date(timestamp#(date2,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY')) - (date(timestamp# (date1,'MM/DD/YYYY hh:mm:ss'),'DD/MM/YYYY')), 'd') as DTDiff
Also find the attachment.
Regards,
Nirav Bhimani
Just use interval function as
Interval(Date1-Date2,'d')
Thanks
Hi,
Try like this
=Ceil(Interval(Date#('4/16/2013 12:00:00', 'MM/DD/YYYY hh:mm:ss') - Date#('4/11/2013 12:40:32', 'MM/DD/YYYY hh:mm:ss'), 'DD' ))
Hope this helps you.
Regards,
Jagan.
Hi Saaru,
i have some douts on you requrement you want to display days only or time also.
what is the result for your test data.
Regards
SHAIK
Hi Saaru,
i have some douts on you requrement you want to display days only or time also.
what is the result for your test data.
Regards
SHAIK
try this
Make sure that your format of date in both field must be same
Date(Date#(Field2,'MM/DD/YYYY hh:mm:ss')-Date#(Field1,'MM/DD/YYYY hh:mm:ss'),'DD') as RestDays
or you can use interval also
Interval(Field2 -Field1,'DD')as Newdays
Thanks Jagan!!
It works when i apply your formula but when I replace with actual field then it is not working like below
=Ceil(Interval(Date#([Field2], 'MM/DD/YYYY hh:mm:ss')-Date#([Field1], 'MM/DD/YYYY hh:mm:ss') , 'DD'))
Am i missing something?