On Wed, 28 Oct 2015 07:16:00 -0700, shruti kapoor
<[email protected]> wrote:
> Hi all
>
> I have an xml like
> <root>
> <admissionDate>20120101</admissionDate>
> <name>ABC</name>
> </root>
>
>
> I am using ODBC server. So I have created an element range index on
> admissionDate and added in my SQL view.
>
> I need to display the date in the format 2012-01-01.
>
> Any help is appreciated.
>
You can use either the SQL-specific builtins to get there:
select
concat(year(admissionDate),"_",month(admissionDate),"_",day(admissionDate))
Or you can use the builtin functions
select
fn_format_dateTime(xdmp_parse_yymmdd("yyyyMMdd",admission),"[Y0001]-[M01]-[D01]");
Many of the builtin functions available in XQuery are also available in
SQL too. You can do queries against the sys_functions table to find out
which ones.
//Mary
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general