I wouldn't do it this way, it's far more complex than you need. Try fq=Startdate__D:[NOW/DAY-7DAYS TO NOW/DAY+1DAY].
Why the weird NOW/DAY+1DAY? Well, that makes fq clauses far more likely to be reused, see: https://lucidworks.com/blog/2012/02/23/date-math-now-and-filter-queries/ Best, Erick On Tue, Nov 22, 2016 at 7:29 PM, Sadheera Vithanage <sadhee...@gmail.com> wrote: > Hi All, > > I am struggling to get the difference of 2 days and return the matching > documents. > > I got the below function query to work, however I am unable to pass a > fieldname for *u *in frange function. > > {!frange l=0 u=864000000}ms(NOW,StartDate__d) > > > What I really want to do is compare the start date with today's date and > return the documents that falls within a date range.For example 7 days. > > Thank you. > > -- > Regards > > Sadheera Vithanage