This discussion is archived
3 Replies Latest reply: Apr 3, 2012 7:23 AM by user12679330 RSS

incrementing date part from a given dateandTime value.

user12679330 Newbie
Currently Being Moderated
Hi,

I have a requirement where in I will get a date value from a

declare namespace xf = "http://tempuri.org/";
declare namespace ns0 = "http://www.domain.com/A";
declare namespace s01 = "http://www.domain.com/B";
declare namespace ns1 = "http://www.domain.com/C";

declare function xf:input_to_reeive($abc as element(ns0:rootelement))
as element(s01:MainStatus) {
<s01:Result>
<s01:header>
<s01:uniqueId>{ data($abc/ns1:header/ns1:id) }</s01:uniqueId>
<s01:createdDate>{ data($abc/ns1:header/ns1:createdTime) }</s01:createdDate>
<s01:expiryDate>xf:expiryDate(data($abc/ns1:header/ns1:createdTime))</v01:expiryDate> // this functionality is what expected.
</s01:header>
<s01:status>PROCESSED</s01:status>
</s01:Result>
};

declare variable $abc as element(ns0:rootelement) external;

xf:input_to_reeive($abc)

in the above xquer I have tupdate the expiryDate as, reading the value from the createdTime, i have to increment the date value as +1.

suppose my input is having for this data($abc/ns1:header/ns1:createdTime) as *2009-08-01T10:10:10*
I have to update the expiryDate as *2009-08-02T10:10:10* (exactly 24 hours later for/from the creation time value).

Could you please advice how i can do this, in the same xquery function above shown, adding another function to it and calling it from the expiryDate element to get the increment date value.

Thanks.

Edited by: user12679330 on 03-Apr-2012 05:53

Edited by: user12679330 on 03-Apr-2012 06:07

Edited by: user12679330 on 03-Apr-2012 06:10

Edited by: user12679330 on 03-Apr-2012 06:10

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points