Hi, I am using a Filter Builder to filter my grid. This works until I try to use the N days ago or similar options. For Today or Yesterday it works correctly as in it creates a filter with date >= start of today and <= end of today
SELECT ... FROM SDPE.v_portal_dissemination_prep WHERE DATASET_ID='106' AND (((sdpe.v_portal_dissemination_prep.START_DATE >= TO_DATE('2016-03-30 00:00:00','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE <= TO_DATE('2016-03-30 23:59:59','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE IS NOT NULL) AND '1'='1'))
but if I try to use N days ago it renders as this:
SELECT COUNT(*) FROM SDPE.v_portal_dissemination_prep WHERE DATASET_ID='106' AND (((sdpe.v_portal_dissemination_prep.START_DATE = TO_DATE('2016-03-30 00:00:00','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE IS NOT NULL) AND '1'='1'))
So it doesn't look far a date range, rather it looks for an exact date. If I output the criteria as string they look like this:
14:48:14.417:pointerup1:WARN:Log:Filter Criteria = {
"_constructor":"AdvancedCriteria",
"operator":"and",
"criteria":[
{
"fieldName":"START_DATE",
"operator":"equals",
"value":{
"_constructor":"RelativeDate",
"value":"$yesterday"
}
}
]
}
15:34:54.196:pointerup6:WARN:Log:Filter Criteria = {
"_constructor":"AdvancedCriteria",
"operator":"and",
"criteria":[
{
"fieldName":"START_DATE",
"operator":"equals",
"value":{
"_constructor":"RelativeDate",
"value":"-1d[-0D]"
}
}
]
}
Is there anyway to change this behavior? So that it always uses a date range.
Thanks
Emmet
SELECT ... FROM SDPE.v_portal_dissemination_prep WHERE DATASET_ID='106' AND (((sdpe.v_portal_dissemination_prep.START_DATE >= TO_DATE('2016-03-30 00:00:00','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE <= TO_DATE('2016-03-30 23:59:59','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE IS NOT NULL) AND '1'='1'))
but if I try to use N days ago it renders as this:
SELECT COUNT(*) FROM SDPE.v_portal_dissemination_prep WHERE DATASET_ID='106' AND (((sdpe.v_portal_dissemination_prep.START_DATE = TO_DATE('2016-03-30 00:00:00','YYYY-MM-DD HH24:MI:SS') AND sdpe.v_portal_dissemination_prep.START_DATE IS NOT NULL) AND '1'='1'))
So it doesn't look far a date range, rather it looks for an exact date. If I output the criteria as string they look like this:
14:48:14.417:pointerup1:WARN:Log:Filter Criteria = {
"_constructor":"AdvancedCriteria",
"operator":"and",
"criteria":[
{
"fieldName":"START_DATE",
"operator":"equals",
"value":{
"_constructor":"RelativeDate",
"value":"$yesterday"
}
}
]
}
15:34:54.196:pointerup6:WARN:Log:Filter Criteria = {
"_constructor":"AdvancedCriteria",
"operator":"and",
"criteria":[
{
"fieldName":"START_DATE",
"operator":"equals",
"value":{
"_constructor":"RelativeDate",
"value":"-1d[-0D]"
}
}
]
}
Is there anyway to change this behavior? So that it always uses a date range.
Thanks
Emmet
Comment