Hi, I a trying to create a report that will run on a schedule and contains the data from the previous month. I tried to do this in SQL using the following statement that I found in a forum: WHEREPOST_DATE >= DATEADD(month, DATEDIFF(month, 0, getdate()) - 1, 0)AND POST_DATE < DATEADD(month, DATEDIFF(month, 0, getdate()), 0)[/code]Now I get the following error for both dateadd and datediff[/code]DATEADD in *LIBL type *N not found (AS400-DB2) As I am not able to get this working I was wondering if it is posibble to create two variables/parameters in Ireport that I use that will pass the first and the last date of the previous month to the SQL. Hope someone can help me out. Thanks Agavus