Hi,
Per the documentation, "This function is only available for use within SQL; it
is not available directly from XQuery, XSLT, or JavaScript." -
https://docs.marklogic.com/sql:dateadd
The equivalent operation to your example in xQuery is:
xs:dateTime('2008-11-11T13:23:44.657') + xs:dayTimeDuration('P45D')
Best,
Rob
Rob Szkutak
Associate Consultant
MarkLogic Corporation
[email protected]
Cell +1.716.562.8464
www.marklogic.com<http://www.marklogic.com>
________________________________
From: [email protected]
[[email protected]] on behalf of Javier Lizarraga
[[email protected]]
Sent: Tuesday, December 29, 2015 4:00 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] sql:dateadd function
Hi All,
I have a use case where I need to add a day to a given dateTime variable. I
would like to use the sql:dateadd function to do this.
However, when I try to run it in Query Console I get an error:
[1.0-ml] XDMP-UNDFUN: (err:XPST0017) Undefined function sql:dateadd()
Here is the code I am running in Query Console.
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
declare namespace sql = "http://marklogic.com/xdmp/sql";
sql:dateadd('day',45, '2008-11-11T13:23:44.657')
It’s not finding the function, but I am not clear on how to reference it.
Thanks,
Javier
Disclaimer
The information contained in this communication from the sender is
confidential. It is intended solely for use by the recipient and others
authorized to receive it. If you are not the recipient, you are hereby notified
that any disclosure, copying, distribution or taking action in relation of the
contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been
automatically archived by Mimecast Ltd, an innovator in Software as a Service
(SaaS) for business. Providing a safer and more useful place for your human
generated data. Specializing in; Security, archiving and compliance. To find
out more Click Here<http://www.mimecast.com/products/>.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general