Hello,
I've got an XML file saved from DataSet. One table has datetime column
(datatype - xs:dateTime). XML file fragment for example:
<Root>
<Element>2004-03-15T00:00:00.0000000+01:00</Element>
<Element>2004-03-16T00:00:00.0000000+01:00</Element>
<Element>2004-03-17T00:00:00.0000000+01:00</Element>
<Element>2004-03-18T00:00:00.0000000+01:00</Element>
</Root>
I'm trying to get MyXmlNodeList using
MyXmlDataDocument.DocumentElement.SelectNodes(MyXP athString) method, where
MyXPathString, for example, should look like:
"/Root/Element[DateFrom >= '2004-03-16T00:00:00.0000000+01:00']"
Problem: None of nodes are selected/returned if I use ">=" or "<="
comparison operators, but I could get a result using "=" operator.
Question: How to compare datetime strings?
Thank you,
Viktor 4 9526
See the following article: http://www.biglist.com/lists/xsl-lis.../msg00492.html
"Viktor Jevdokimov" <vj*********@hotmail.com> skrev i meddelandet
news:uL**************@TK2MSFTNGP09.phx.gbl... Hello,
I've got an XML file saved from DataSet. One table has datetime column (datatype - xs:dateTime). XML file fragment for example:
<Root> <Element>2004-03-15T00:00:00.0000000+01:00</Element> <Element>2004-03-16T00:00:00.0000000+01:00</Element> <Element>2004-03-17T00:00:00.0000000+01:00</Element> <Element>2004-03-18T00:00:00.0000000+01:00</Element> </Root>
I'm trying to get MyXmlNodeList using MyXmlDataDocument.DocumentElement.SelectNodes(MyXP athString) method, where MyXPathString, for example, should look like: "/Root/Element[DateFrom >= '2004-03-16T00:00:00.0000000+01:00']"
Problem: None of nodes are selected/returned if I use ">=" or "<=" comparison operators, but I could get a result using "=" operator.
Question: How to compare datetime strings?
Thank you, Viktor
And use XmlDocument instead of XmlDataDocument
Yan
"Magnus" <Ma********@discussions.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP11.phx.gbl... See the following article: http://www.biglist.com/lists/xsl-lis.../msg00492.html
"Viktor Jevdokimov" <vj*********@hotmail.com> skrev i meddelandet news:uL**************@TK2MSFTNGP09.phx.gbl... Hello,
I've got an XML file saved from DataSet. One table has datetime column (datatype - xs:dateTime). XML file fragment for example:
<Root> <Element>2004-03-15T00:00:00.0000000+01:00</Element> <Element>2004-03-16T00:00:00.0000000+01:00</Element> <Element>2004-03-17T00:00:00.0000000+01:00</Element> <Element>2004-03-18T00:00:00.0000000+01:00</Element> </Root>
I'm trying to get MyXmlNodeList using MyXmlDataDocument.DocumentElement.SelectNodes(MyXP athString) method, where MyXPathString, for example, should look like: "/Root/Element[DateFrom >= '2004-03-16T00:00:00.0000000+01:00']"
Problem: None of nodes are selected/returned if I use ">=" or "<=" comparison operators, but I could get a result using "=" operator.
Question: How to compare datetime strings?
Thank you, Viktor
As I thought. Thanks.
"Magnus" <Ma********@discussions.microsoft.com> wrote in message
news:OX**************@TK2MSFTNGP11.phx.gbl... See the following article: http://www.biglist.com/lists/xsl-lis.../msg00492.html
"Viktor Jevdokimov" <vj*********@hotmail.com> skrev i meddelandet news:uL**************@TK2MSFTNGP09.phx.gbl... Hello,
I've got an XML file saved from DataSet. One table has datetime column (datatype - xs:dateTime). XML file fragment for example:
<Root> <Element>2004-03-15T00:00:00.0000000+01:00</Element> <Element>2004-03-16T00:00:00.0000000+01:00</Element> <Element>2004-03-17T00:00:00.0000000+01:00</Element> <Element>2004-03-18T00:00:00.0000000+01:00</Element> </Root>
I'm trying to get MyXmlNodeList using MyXmlDataDocument.DocumentElement.SelectNodes(MyXP athString) method,
where MyXPathString, for example, should look like: "/Root/Element[DateFrom >= '2004-03-16T00:00:00.0000000+01:00']"
Problem: None of nodes are selected/returned if I use ">=" or "<=" comparison operators, but I could get a result using "=" operator.
Question: How to compare datetime strings?
Thank you, Viktor
Yan Leshinsky wrote: And use XmlDocument instead of XmlDataDocument
Or even XPathDocument if you only need to query data, not edit.
--
Oleg Tkachenko [XML MVP] http://blog.tkachenko.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Donnal Walter |
last post by:
I was very surprised to discover that
>>> import datetime
>>> x = datetime.date(2004, 9, 14)
>>> y = datetime.datetime(2004, 9, 14, 6, 43, 15)
>>> print x == y
True
How can these two...
|
by: steve bull |
last post by:
I have the following code snippet to read the colorRange attributes for the colorRangeSwatch in the xml file listed
below.
string expr = "/swatches/colorRangeSwatch/colorRange";...
|
by: dingbat |
last post by:
Losing my marbles here (some sleep would help!)
Why are the following XPath comparisons both returning false ?
<xsl:value-of select="string('2005-09-22T12:43:23') >...
|
by: Hollywood |
last post by:
I have the following XSD created in VS.NET 2003:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="ReferralSchama" targetNamespace="http://test.org/Referral"...
|
by: Echo 8 |
last post by:
Is there a simple way of compare dates? I am trying to create a list of
perishable stock in an inventory that is near or past its expiration date.
I've tried telling it to compare a node's value...
|
by: elziko |
last post by:
Hi I have two date times that I belive to be equal. However, when I do a
comparison I find that date1 is less than date2...
Console.WriteLine(date1.ToString("dd/MM/yyyy HH:mm:fffffff") + " - " +...
|
by: Nishad |
last post by:
Is anybody know how to write xpath for string Value Comparisons
thank you
|
by: jmagaram |
last post by:
I have a DataSet I want to work with as Xml using XmlDataDocument. I can't
figure out how to query the resultant Xml using XPath. From the following XML
below, what XPath query will return the list...
|
by: MikeL |
last post by:
I'm using .Net 2.0. I realize that this means XPath 1.0 (which is
ridiculous).
So here's a document that I have that's not on disk but held in a variable
(I queried an Exchange appointment...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |