Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9071

Re: Duration field is giving incorrect result in substrating two date and time field

$
0
0

Neha,

Agentry Date/Time variables keep the number of seconds past the Agentry epoch (Jan 1, 2001?).  You can take the DIFF between two DateTime properties to get the difference in seconds like you suggested.  Not sure why you are having trouble with this.  Make sure you always subtract the smaller from the larger.

 

I created a test screen with two DateTime fileds: Date1 and Date2.  The third field is an Integer called Diff that has an update rule to calculate the difference between the two.  It checks to see which date is larger before doing the DIFF.

 

12-22-2014 10-57-32 AM.png

 

Above image displays 86,400 seconds which is the number of seconds in 24 hours.  This is the difference between Date1 subtracting Date2.

 

12-22-2014 10-58-11 AM.png

 

Above image displays 172,800 seconds which is the number of seconds in 48 hours.  This is the difference between Date2 subtracting Date1.

 

 

12-22-2014 10-59-31 AM.png

 

Above image shows the update rule that does the math.

 

Jason Latko - Senior Product Developer at SAP


Viewing all articles
Browse latest Browse all 9071

Trending Articles