If this is the case then you should try the afteInsertHook I mentioned earlier
Here is the documentation for it here .
First, create a hook in your database like so:
Choose the .afterInsertHook option
Next, we have two parameters to work with(item, context), but for not we just want the item parameter as this has the item that is being inserted. We want to get the items _createdDate field value and translate it into a string so that we can query a string with a string value instead of a date/time value that it currently is.
We can change it into this format: mm-dd-yyyy using this piece of code:
date = new Date(‘2013-03-10T02:00:00Z’);
(date.getMonth()+1) + ‘-’ + date.getDate() + ‘-’ + date.getFullYear();
More on that here .
All together it will look something like this:
Now you can properly query the date using a string like you have been doing.
Hope this helps,
Majd

