Hey guys,
In the past I used to have a field defined as date, though I have made changes to the field so it's now stored as a string. The side effect of this change I've made is that I defined a custom filter for this field which crits are as follows:
'__january'=>array('~"polisa_renew_date'=>DB::Concat(DB::qstr('%'), DB::qstr('-01-'), DB::qstr('%'))),
'__february'=>array('~"polisa_renew_date'=>DB::Concat(DB::qstr('%'), DB::qstr('-02-'), DB::qstr('%')))
...etc...
Since I am currently storing the string as m/Y format, for example: 3/2010
then I need to use a different type of crit definition, what I've come up with (that seems to work) is this:
'__march'=>array('~"polisa_renew_date'=>DB::Concat(DB::qstr('3/'), DB::qstr('%'))),
Though I am not sure if it's optimal, maybe there's another way of doing it?
I appreciate your help.
Regards,
Liran.