Hi Adam, With FunctionQuery (http://wiki.apache.org/solr/FunctionQuery) & DateMath ( http://lucene.apache.org/solr/4_5_1/solr-core/org/apache/solr/util/DateMathParser.html) - round to the day level, subtract & divide by milliseconds_in_a_day (86400K).
?q=*floor*(*div*(*sub*(*ms*(NOW/DAY),*ms*(NOW-1YEAR/DAY)),86400000)) &wt=xml&defType=func &fl=*,score Replace 'NOW-1YEAR' with you 'date_Field' (should be a TrieDateField). Regards, Aloke On Wed, Nov 6, 2013 at 12:55 AM, Adam Harris <ahar...@marketforce.com>wrote: > Hey All, > > Using solr I want to get the difference between two dates, is this > possible? > Something similar to > SELECT DateDiff(d, GetDate(), date_Field) as Diff FROM MyTable > On Wed, Nov 6, 2013 at 12:55 AM, Adam Harris <ahar...@marketforce.com>wrote: > Hey All, > > Using solr I want to get the difference between two dates, is this > possible? > Something similar to > SELECT DateDiff(d, GetDate(), date_Field) as Diff FROM MyTable >