Hi Jean,
The record count you see on the 'Status Bar' at the bottom is the number of records returned from the database.
I looked at the query and the twelve rows of data from the screenshot. What's happening is that the report pulls in all the twelve rows of data based on the where clause:
where
.
.
Folder.INDATE >= {?FromDate} and Folder.INDATE< {?DateTo} + 1
I also see that you have a 'Record Selection Formula' to further restrict the records based on the value chosen in the {?DateType} prompt.
Since the report is created against a SQL Query, this selection formula is Not passed back to the database. In effect, the report will always process any more filters 'on the twelve rows of data' it has received from the database.
I would recommend creating the 'DateType' prompt in the Command just like the other prompts in there. Something like this should work and should be far more efficient too:
where
.
.
.
AND
(
Case
When {?DateType} = 'IN' then Folder.INDATE >= {?FromDate} and Folder.INDATE< {?DateTo} + 1
When {?DateType} = 'Issue' then Folder.ISSUEDATE >= {?FromDate} and Folder.ISSUEDATE< {?DateTo} + 1
When {?DateType} = 'Expires' then Folder.EXPIRYDATE>= {?FromDate} and Folder.EXPIRYDATE< {?DateTo} + 1
END
)
-Abhilash