cancel
Showing results for 
Search instead for 
Did you mean: 

Create a filter for the last day of the months

Former Member
0 Kudos

Hi,

I wanna know if is possible create a filter that select the last day of the past month int he IDT or I need to create the function in the database and insert the result of the function in an filter.

I have some webi reports that must be updated and sent through email every 1 of every month, showing information about the past month.

If someone have knows another way to do this, let me know please

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It depends what DBMS you use.

For Oracle, the SQL definition of the object would be:

trunc(sysdate,'mm')-1

SQL Server would be a bit more of a mouthful:

dateadd(d,-1,cast(convert(char(7),getdate(),23)+'-01' as datetime))

Please note that the object will not parse because it is not associated with a table. This won't matter so long as you use it with a table based object in your queries. If someone suggests you associate it with a table to get it to parse, don't. You will always have that table in every query that you run with that object, which could produce erroneous results.