jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: xpath and date comparison in search
Date Thu, 13 Apr 2006 16:12:56 GMT
you can use the xs:dateTime() function to create a date value from a string:

[@plan:status != 'ARCHIVED'
  and @plan:lastModified > xs:dateTime('2006-03-13T18:10:49.629+02:00')
  and @plan:lastModified < xs:dateTime('2006-04-13T18:10:49.629+02:00')
  ] order by @plan:lastModified descending

regards
  marcel

Bjorn Bength wrote:
> Hello,
> 
> Im trying to construct a query in xpath where a want to find all
> documents where the attribute @plan:lastModified is between two
> user supplied dates.
> How would i construct such a query?
> 
> here is an example of the last part of my criteria:
> works ok:
> [@plan:status != 'ARCHIVED'] order by @plan:lastModified descending
> 
> 
> i have tried several combinations that dont work; including casting to
> xs:dateTime, converting to millies, strings in different formats.
> 
> I wanna do:
> 
> [@plan:status != 'ARCHIVED' 
> and @plan:lastModified > {my 1st date}
> and @plan:lastModified < {my 2nd date}
> ] order by @plan:lastModified descending
> 
> 
> 


Mime
View raw message