I'm guessing you mean having 2 date parameters (begin and end range) , which display the little calendar and you click the date.
I wrote a quick report and it worked OK. Here's what I did.
1) Identify the SQL date column which you want the range test to be applied to.
2) Add and ad hoc parameter to that date column.
3) In Tools->Paramters set that parameter to Hidden.
We will set the range from the 2 date parameters.
4) In Tools->Paramters create 2 date parameters of type Date.
Eg: Date_Begin and Date_End.
When the program runs, the user will pick the dates from the calendar that
appears.
5) In the Datasource::ObtainSelectstatement method, we will access the 2 date
parameters, add the required syntax around them, them move the new string to
the hidden ad hoc param.
Here's my code:
Function ObtainSelectStatement( ) As String
' Insert your code here
showFactorystatus("BeginDate = " & Date_Begin)
showFactorystatus("EndDate = " & Date_End)
Dim s As String
' Create the required search string
' Note there is a hyphen in the middle. Thus # - #
'
s = "#" & Date_Begin & "#-#" & Date_End & "#"
' Move the string to the parameter
orders_askByDate = s
ObtainSelectStatement = Super::ObtainSelectStatement( )
' Show the SQL
showFactoryStatus("ObtainSelectStatement = " & ObtainSelectStatement)
End Function
NOTE: You would need to add code to ensure the user does not enter a
backward range. Not that it matters, simply no rows would get returned.
Hope this helps
Milton