xsl-list
[Top] [All Lists]

RE: get Data BETWEEN FromDate and ToDate

2005-05-20 06:32:32

<Employees>
<Employee Empname="Raj" Empname="Raj" DOJ ="02/04/2005"   
SftTime="0030"

<Employee Empname="Rajkumar" DOJ ="02/04/2005"   SftTime="0030"     >
<Employee Empname="Raja" DOJ ="03/04/2005"   SftTime="0000"     >
<Employee Empname="Ravi" DOJ ="04/04/2005"   SftTime="2330"     >
<Employee Empname="john" DOJ ="05/04/2005"   SftTime="1600"     >
<Employee Empname="gopi" DOJ ="06/04/2005"   SftTime="0100"     >
<Employee Empname="ajith" DOJ ="13/04/2005"   SftTime="2200"     >
</Employees>

i want to filter only employees in DOJ between 05/04/2005 and 
13/04/2005
these date. thatsall.

It looks as if your dates are in the format dd/mm/yyyy, which although more
logical than the form mm/dd/yyyy, still does not sort naturally.

With XSLT 1.0, the technique is to convert the dates to numbers like this:

number(concat(substring(x, 7, 4), substring(x, 4, 2), substring(x, 1, 2)))

and then compare the numbers.

(This is assuming the month and day are always two digits: I shouldn't
really assume that simply because it's true for the six records shown
above).

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>