![]() |
.. (לתיקייה המכילה) | |
In q3 we are asked to sort by date. | |
There is no simple casting to do this. you can sort by the string value which doesn't mean necessary it will be good by the date value. A bonus of 2 points will be given for people doing it right. hint: You'll need to use "replace" function and regular expressions, to get to canonical value, and then sorting by the string value, or casting first to dateTime and then sorting would be possible. For example: let $fd := replace($d,"\S+ (\d+) Oct (\d+) (\d\d:\d\d:\d\d) ([+-]\d\d)(\d\d)","$2-10-$1T$3$4:$5") (:you'll need to repeat this for every month:) let $fdd := $fd cast as xs:dateTime (:you can also do without the casting:) order by $fd (:$fdd it doesn't matter:) you can find a useful documentation here: | |
קישור: Link: Ссылка: وصلة: | http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.xquery.doc/xqrdate.html |