I suppose you have a form where data is displayed in a table frame or as individual fields.
For performance considerations, you should first have an index where the date is the first field. Other fields can be in the index.
Then, to retrieve min max dates from the user, a quick and dirty way is to have 2 date variables and use the view () function :
minDate.view ()
maxDate.view ()
The user is presented a box with the current value, and can alter it. Since its a date variable, a validity check is performed.
Or you can have 2 undefined fields in the form, along with a button the user must press after filling the fields. You have then to ensure date validity by code.
When you have the dates, its quite straightforward. Lets say myUiObject is a (UI) field of your table, a tableFrame or object containing them (only if your table is the primary table in the form's data model). Use the code
myUiObject.switchIndex ("iDate", true)
in the case the form wasnt already using your index ; iDate is the name of the index used with the date as first field ; true is optional and tells the form to stay on the current record if possible.
myUiObject.setRange (minDate, maxDate)
to limit the view to the range you want.
then you can use
myUiObject.setRange ()
to reset the view to all records.
Hope this aint too confusing.