cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a Default value in Date filter where the date should be 1 month before the current date

Former Member
0 Kudos

Hi Experts,

I am facing an issue while getting a default value in date filter which is 30 days before the current date.

I have done the following things in order to solve that:

1. In Filter Prompts tab, I have added CREATED_AT date filter where I have given <%Today%> token in Default Value field. So when we preview the query we     can see by default the current date is getting populated in the CREATED_AT filter.

2. I have Changed the default value to "<%TODAY%> - 30".So I m getting an error.

3. I have used functions like FCI_DATEDIFF etc.,but that default value field is not accepting any functions.It is showing an error.

Can anyone pls help me out in solving this issue. Any help would be appreciated.

Thanks & Regards,

vignesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vignesh,


I have a similar requirement to you and have solved it by using the same method as in the standard system query called FCI-RecentlyExpiredAgreements.


To get all projects with a base date within the last 180 days to be shown in my report by default I used the following code in my query:


A.BASE_DATE_DATE <= <%TS%> AND

(

<%SCHEMA%>.FCI_DATEDIFF( A.BASE_DATE_DATE, <%TS%>, 16) <= ?

)

In my filter I have data type Integer and the default value set to 180.

I hope this helps.

Regards

Dan


Former Member
0 Kudos

Hi Dan,

Thanks for your reply but my requirement is like, by default the date should get populated, not the number of days(180). That too 30 days before the current date.

Thanks & Regards,

vignesh