I need to filter for and specific date in a database view (OPENED AT >= 2017 - 01 - 01 )

luislembertsant
Kilo Expert

find_real_file.png

I need the where clause with 2 conditions :

1-     tsk_opened_at >= DATE('2017-01-01') but nothing happend.....

2-       (tsk_sys_class_name ='request' || tsk_sys_class_name ='incident' || tsk_sys_class_name ='catalog task' || tsk_sys_class_name ='external customer support' )

I have tried in differents way many times without any results.

Coud someone advice me ?

1 ACCEPTED SOLUTION

It seems you cant create a DB view with only one table, a workaround would be to add the task table a second time with prefix tsk2.


Then in tsk2 where clause set:



tsk_sys_id = tsk2_sys_id   && tsk_opened_at > '2017-01-01 08:00:00' &&


(tsk_sys_class_name ='sc_request' ||


tsk_sys_class_name ='incident' ||


tsk_sys_class_name ='sc_task' ||  


tsk_sys_class_name ='u_external_customer_support'




find_real_file.png



Also make sure you are using the table name, not the label, for example sc_request instead of Request



find_real_file.png


View solution in original post

18 REPLIES 18

Hi Arnoud,


I tried on this way with sys_created_on but I'm only receiving the sys_class_name='request'. I'm very sure that I have more data for the others sys_class_name


find_real_file.png


It seems you cant create a DB view with only one table, a workaround would be to add the task table a second time with prefix tsk2.


Then in tsk2 where clause set:



tsk_sys_id = tsk2_sys_id   && tsk_opened_at > '2017-01-01 08:00:00' &&


(tsk_sys_class_name ='sc_request' ||


tsk_sys_class_name ='incident' ||


tsk_sys_class_name ='sc_task' ||  


tsk_sys_class_name ='u_external_customer_support'




find_real_file.png



Also make sure you are using the table name, not the label, for example sc_request instead of Request



find_real_file.png


Hi Arnoud you are right!


Thanks...


Good, good luck!


I have added my initial response to the answer you marked correct, so it's easier to find.