Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to retrive xml date into sql

Status
Not open for further replies.

hlybbi

Programmer
Mar 19, 2003
91
IS
Hello im new in xml,
the problem i am trying to solve is that i need to retrive exchange rate from this site i have tryed to get the information using asp script but it is not working where well, what i was wondering can i use sql to get these information and but the into a data base





Best regards Hlynur
 
From the site:
[tt]
<upplysingar>
<texti>Almennt gengi Búnaðarbankans</texti>
<vikudagur>föstudag</vikudagur>
<manadardagur>19.12.2003</manadardagur>
<kl>16:13</kl>
</upplysingar>
[/tt]
The format DD.MM.YYYY isn't a valid XML date format. It should be in ISO-8601 or RFC-3339 format (YYYY-MM-DDTHH:NN:SS where &quot;T&quot; is a required literal character).

But that aside, you should be able to read the date as a string. The problem is getting a database to recognize it. MS-SQL Server 2000 documentation says it recognizes these formats:
[tt]
[0]4/15/[19]96 -- (mdy)
[0]4-15-[19]96 -- (mdy)
[0]4.15.[19]96 -- (mdy)
[04]/[19]96/15 -- (myd)

15/[0]4/[19]96 -- (dmy)
15/[19]96/[0]4 -- (dym)
[19]96/15/[0]4 -- (ydm)
[19]96/[04]/15 -- (ymd)
[/tt]
As you can see, day-month-year separated by periods is not on the list. So you will need to reformat the date value before attempting to insert it into the database.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top