Microsoft
Software
Hardware
Network
Question : Xquery assign datetime variable
hi,
i have the following code
current-time() + xs:dayTimeDuration(string(
concat('PT
', $i, 'M')))
which uses the current-time() function from xquery and adds mins to it.
let's say i want to subsitute the current-time() with a date time in string format
25/12/2006 15:00:30
how do i go about doing it?
thanks.
Answer : Xquery assign datetime variable
given that the time value lands in a variable $time
let $time := "25/12/2006 15:00:30"
you can cast to the dataTime format like this
xs:dateTime(replace($time,
'(\d+)/(\d+)/(\d+)\s+(.*)$
', '$3-$2-$1T$4'))
Random Solutions
Query Event Log
DW MX Design View Issue
delay notifications from AOL and GT.RR.COM, exchange 2003
Output XML from SQL
Deploying Windows 7 via K2000
Useless Windows 7 Services?
Microsoft Hyper-V Server 2008 R2 - Is there a benefit to a small organisation?
SQL Temporary Tables MS SQL 2005
Outlook 2007 keeps bombing every five minutes or so. Send error report?
word/excel don't show any printers on terminal server, but outlook/notepad/IE/etc work perfectly