cancel
Showing results for 
Search instead for 
Did you mean: 

Xpath selectnodes query for given date

g_rathod
Star Contributor
Star Contributor
Friends,

I have query which runs using TYPE filter/property value filter and date range filter.
Which runs fine on LUCENE.

I want same query to be run using XPATH selectNodes query in java.

e.g.

/app:company_home/cm:T3/cm:Trade/cm:test_9b8adc70-6a83-4104-8783-53d569b04801/cm:Foods/*/*[subtypeOf('t3:test')
and @t3:endDate>='2013-04-10T00:00:00' ]

Every time I got zero results. I tried using different date formatter but there is no luck here.
Can anyone tell me how to run this (endDate greator than or equals given date in query)

1 REPLY 1

kamielvdz
Champ in-the-making
Champ in-the-making
How about this:

search.selectNodes("//*[number(translate(substring(@cm:created,1,10),'-',''))>20130711]");

This is to compare the date only not a full timestamp, but they idea with be applicable to timestamps as well.