Yes you're rigth ! Thanks
Willy On Thu, 13 Sep 2012 23:45:15 +0400, Ivan Shcheklein <[email protected]> wrote: > Ok, seems that it's how XQuery should work: > > http://www.w3.org/TR/xpath-functions/#func-subtract-dates [1] > > > OP:SUBTRACT-DATES($ARG1 AS XS:DATE, $ARG2 AS XS:DATE) AS XS:DAYTIMEDURATION > > > http://www.w3.org/TR/xpath-functions/#func-years-from-duration [2] > > IF $ARG IS AN XS:DAYTIMEDURATION RETURNS 0. > > It's seems to me that you can't get correctly number of years from > number of days between two dates. > > On Thu, Sep 13, 2012 at 11:13 PM, wrote: > Currently we use the latest version 3.5 > > Thanks, > > Willy > > On Thu, 13 Sep 2012 22:58:48 +0400, Ivan Shcheklein > wrote: > > Hi Willy, > > > > Which version of Sedna do you use? > > > > Ivan Shcheklein, > > Sedna Team > > > > Hello all, > > > > I’m confused by values return by the years-from-duration > function. > > > > In the following code, $age duration is equal to P3071D which is > a > > correct value. > > > > But years-from-duration function returns 0, and > month-from-duration > > also returns 0. Only days-from-duration return 3071. > > > > let $d1 := xs:date('2001-10-03') > > let $d2 := xs:date('2010-03-01') > > let $age := xs:duration($d2 - $d1) > > > > let $ageY := years-from-duration($age) > > return {$ageY} > >> > > It sounds like a bug in the xQuery interpreter ? > > > > Thank you for your help, > > > > Willy > > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security > and > > threat landscape has changed and how IT managers can respond. > > Discussions > > will include endpoint security, mobile security and the latest > in > > malware > > threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ [5] > > [1] > > _______________________________________________ > > Sedna-discussion mailing list > > [email protected] [6] [2] > > https://lists.sourceforge.net/lists/listinfo/sedna-discussion > [7] [3] > > > > > > > > Links: > > ------ > > [1] http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ [8] > > [2] mailto:[email protected] [9] > > [3] https://lists.sourceforge.net/lists/listinfo/sedna-discussion > [10] > > > > Links: > ------ > [1] http://www.w3.org/TR/xpath-functions/#func-subtract-dates > [2] http://www.w3.org/TR/xpath-functions/#func-years-from-duration > [3] mailto:[email protected] > [4] mailto:[email protected] > [5] http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > [6] mailto:[email protected] > [7] https://lists.sourceforge.net/lists/listinfo/sedna-discussion > [8] http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > [9] mailto:[email protected] > [10] https://lists.sourceforge.net/lists/listinfo/sedna-discussion ------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Sedna-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sedna-discussion
