: I try to get a diff of today and an dateField. from this diff, i want do a : modulo from another field with values of 1,3,6,12 ... : (DIFF(Month of Today - Month of Search) MOD interval) = 0
a) it looks like modulus was never implemneted as a function ... probably overlooked before it has not java.lang.Math.* static? ... please file a bug, it should be fairly trivial to add. b) even with a mod(a,b) function, i'm not sure that you could do whta it seems like you want to do -- the ms() function will easily let you conpute the number of milliseconds between two date field, but there's no fuction that will give you the numeric value for the month of year (or day of month, or hour of day, etc...) for a date field ... even if there was, i don't think your calculation would work when the current month is "before" the month indexed in the date field. If i understand your goal, you are probably better off indexing the month as it's own field (either numericly or just as a simple string) and then computing the list of matches you care about in the client (ie: fq=month:(feb, may, aug, nov) ) -Hoss