Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: mrbigglesdotnetHi there,
I have a data set where the records have a MONTH_START column with monthly data in the format of CCYY-MM-01 (e.g. May 2014 is recorded as 2014-05-01). I need to be able to emit all records that reside within a certain number of months from a definable month. The required records may cross years too.
For example, I may need to emit 3 months worth of data covering Nov 2014, Dec 2014, and Jan 2015. Is there a script that will allow me to define a start month (like 2014-12-01 in column MONTH_START) and emit records from that start month plus the following 2 months?
I tried the following but all it gave me was records from 2014-07-01:
emit * where
'Month_Start' == addDate(("2014-05-01".toDate("CCYY-MM-DD")),2,"months")
Thank you.