This is a discussion on Code in XSLT to compare dates? within the XML and XSLT forums, part of the Beginners AJAX category; What should be the code written in XSLT that will allow me to compare dates from a SQL Server (let's say, SQLExpress)?...
|
|||||||
|
|
#2 (permalink) |
|
Junior Member
Join Date: Oct 2007
Posts: 3
Rep Power: 0 ![]() |
if the dates are stored as integer it's simple, if they are strings yyyymmdd, also easy.
if they are messy US style you have to do a lot of manipulation. http://www.dpawson.co.uk/xsl/sect2/dates.html make sure the sql select reformats the the date to a natural format for simple comparisons XSLT 2.0 can compare date values directly (once they're in ISO format). XSLT 1.0 can only compare numbers. You can convert an ISO date to a number by removing the punctuation: translate($in, '-', ''). To convert a US date to an ISO date, use a combination of substring() and concat(). |
|
|
|
![]() |
| Bookmarks |
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Code in XSLT to display current date? | Melay | XML and XSLT | 1 | 10-27-2007 11:38 AM |
| please please convert the following XML to another XML with XSLT:? | Partha G | XML and XSLT | 1 | 10-27-2007 11:30 AM |
| Where can I learn CSS, XSLT, and XML-RPC? | IS dude | XML and XSLT | 3 | 06-08-2007 07:01 AM |
| SYS-CON Announces Two New "AJAXWorld University Bootcamp" Dates | microbee | AJAX Help | 0 | 01-10-2007 07:15 PM |