|
|
Re: SQL query statement in Report builder 6.0 [message #10726 is a reply to message #10720] |
Thu, 12 February 2004 06:18 |
Rehman
Messages: 19 Registered: February 2000
|
Junior Member |
|
|
Hi,
what I have understood is....
Assume that you are executing ur report on 12th of Feb'04 then the report should default it to previous month. i.e. starting from 01st of Jan - 30th of Jan irrespective of whether you executed on 12th/01st/27th of Feb.
Ex:-
In ur SQL data model, use a lexical parameter.
eg : Select *
From
Where <Date_Col>
Between First_Day(Add_Months(Sysdate,-1))
-- Make sure you define First_Day function which accepts a
-- date value as a parameter and converts to the
-- first_date of previous month.
And Last_Day(Add_Months(Sysdate,-1));
------------------------------------------------------
You cant use the condition as
sysdate - 31....
Trust this will solve ur query.
Rgrds
|
|
|