Hi
Create to static string parameters and give the same values as default values.
Create a Formula with the following to get StartDate Value and compare it with your database field in record selection.
Note : I am giving only for Start Date, you will have to write for End date.
Datevar StDate;
If {?StartDate} = 'Yesterday' then StDate: = Currentdate -1
else
If {?StartDate} = 'First Day of Previous Week' then
StDate: = dateadd('ww',-1,currentdate)-(weekday(currentdate)-2)
else
If {?StartDate} = 'First Day of Previous Month' then
StDate: = dateadd('m',-1,currentdate)-day(currentdate)+1
else
If {?StartDate} = 'First Day of Previous Quarter' then
StDate: =( if Month(currentdate) in [1,2,3] then date(year(currentdate)-1,10,1)
else
if Month(currentdate) in [4,5,6] then date(year(currentdate),01,01)
else
if Month(currentdate) in [7,8,9] then date(year(currentdate),04,01)
else
if Month(currentdate) in [10,11,12] then date(year(currentdate),07,01)
)
else
if {?StartDate} = 'First Day of Previous 12 Months' then
StDate: = date(year(dateadd('y',-1,currentdate)),month(currentdate),01)
else
if {?StartDate} = 'First Day of Previous 6 Months' then
StDate:=date(year(dateadd('m',-6,currentdate)),Month(dateadd('m',-6,currentdate)),01)
StDate;