# getDataSetByQuery

**URL:** <https://forum.servoy.com/t/getdatasetbyquery/2428>\
**Category:** Classic Servoy\
**Created:** [August 8, 2004, 7:22pm UTC](https://forum.servoy.com/t/getdatasetbyquery/2428 "2004-08-08T19:22:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfleming](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rfleming](https://forum.servoy.com/u/rfleming)\
**Post date:** [August 8, 2004, 7:22pm UTC](https://forum.servoy.com/t/getdatasetbyquery/2428/1 "2004-08-08T19:22:40Z")

</div>

i am using getDataSetByQuery to restrict what records all pulled from the main table of the form by using my own MS SQL statement. I am then using controller.loadRecords(pkdataset) to get the records from within my onLoad method. Is there any reason why more records are returned then what I specify in my SQL statement as based on my where clause?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 23, 2004, 1:14pm UTC](https://forum.servoy.com/t/getdatasetbyquery/2428/2 "2004-08-23T13:14:43Z")

</div>

are you sure that you see suddenly more records then what you should see?

Are you really seeing records that shouldn’t be seen based on youre query?
