Are you storing the data using SQLTags Historian, or some other method (Transaction groups, 3rd party, etc…)?
What database are you using?
If it’s stored in the through transaction groups or something similar, you’ll need a query that looks between two date ranges. In MySQL your query binding would look something like this:
SELECT * FROM table WHERE t_stamp BETWEEN time1 AND time2
Where time1 and time2 can be references to the date property of calendar components on your screen somewhere.