strange SQL result [message #992516] |
Fri, 21 December 2012 21:02 |
Bertin Kiekebosch Messages: 330 Registered: August 2011 |
Senior Member |
|
|
Hi,
Working with SQL server 2005 and Scout Juno SR1.
I have the following query
SELECT
clientcase_dbcperiod.ID,
clientcase_dbcperiod.startdate,
clientcase_dbcperiod.enddate,
clientcase_dbcperiod.endedBy,
unit.name
FROM clientcase_dbcperiod
join clientcase on clientcase.ID = clientcase_dbcperiod.clientcaseID
join client on client.ID = clientcase.clientID
join unit on unit.ID = client.unit_Id
WHERE unit.name = 'RID Arnhem'
AND clientcase_dbcperiod.startdate BETWEEN '2010-08-31' AND '2010-10-01'
if I execute this in SQL server management studio I get 19 records in my result set (That is the correct set).
If I execute this Query in Scout like below,
Object[][] recs2 = service.select("select" +
" clientcase_dbcperiod.ID," +
" clientcase_dbcperiod.startdate," +
" clientcase_dbcperiod.enddate," +
" clientcase_dbcperiod.endedBy," +
" unit.name" +
" FROM clientcase_dbcperiod" +
" join clientcase on clientcase.ID = clientcase_dbcperiod.clientcaseID" +
" join client on client.ID = clientcase.clientID" +
" join unit on unit.ID = client.unit_Id" +
" WHERE unit.name = 'RID Arnhem'",
" AND clientcase_dbcperiod.startdate BETWEEN '2010-08-31' AND '2010-10-01'");
I get 1030 records in my result set.
Why is this happening and can I fix this in some way. When analizing things everything is OK until I add the part "unit.name = 'RID Arnhem'"in the where clause.
If I use binding variables I have the same problem.
Regards Bertin
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04197 seconds