cancel
Showing results for 
Search instead for 
Did you mean: 

can the date filter be empty to fetch results?

0 Kudos

Hello Experts,

We have a simple requirement but looks like complex to achieve.

we have a custom date filed in Master agreement and what our client needs is below report which contains only custom date as optional filter

whenever user gives date and click on show it should give the respective results and also

whenever user makes date filter empty and clicks on show it should fetch all the Master Agreements in which the date field is empty.

Please let me know whether this can be done or not

Thanks

Jitendra

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member13619
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Yes this can be done, depending on how you built your query.

This is an example of a SQL statement in your query definition, where startDate is the filter prompt parameter name

<%AND("T1.CREATED_AT >= <%?(startDate)%>")%>

You put the filter startDate on optional and fixed operator.

When you enter a date it will show as from this date (in this example) and when you empty the date and click on show it will show all documents.

Second option is this.

You make a date range and by default set it e.g. from 01.01.1900 to 31.12.9999; if you don't change it, everything is shown and if needed you can set the range to reflect the date(s) you want to see.

here is a sample of such a statement in your query definition:

<%AND("T1.CREATED_AT >= <%?(startDate)%> AND T1.CREATED_AT <= <%?(endDate)%>")%>

Hope this helps you.

0 Kudos

Hi Erik,

Lets say a custom date field is there and a query is written with the same custom date field as filter.

Now when I make the date filter empty and checked on show then the agreements which are having the date field as empty should be fetched(only empty) and when filter is populated with a value then respective results should be fetched.

Thanks

Jitendra