Selct distinct returns incorrect results in SQL 2000
Hi, I am seeking desperate help.
We recently upgraded our SQL server from 7.0 TO 2000. Our user are using Bussines objects tools for the reports. When they use the following query " Select distinct (snapshotdate) from tablename group by snapshotdate" returns incorrect results in the meaning of the dates are missing. Whe we use different set of query " that is by using snapshotdate >= date " fundtion it returns correct information. Data is there. Why am I getting this discripence.
I ran update statistics, rebuild indexes. Optimization and integrity everything performed.
SQL 2000 service pack 2 is also applied to the server and client.
All suggestion are welcome. Seeking help sincierly.
Thanks,
Ramakrishna
select distinct returns incorrect results in sql 2000
In bussiness objects reports tools use distinct function to get the dates.
Here is the query which is giving incorrect results.
"select distinct (snapshotdate) from tablename"
The results from the above query------9/29/2002 0:00
9/30/2002 0:00
10/3/2002 0:00
10/4/2002 0:00
10/7/2002 0:00
10/8/2002 0:00
10/11/2002 0:00
10/12/2002 0:00
10/16/2002 0:00
10/17/2002 0:00
10/20/2002 0:00
10/21/2002 0:00
10/24/2002 0:00
10/25/2002 0:00
10/29/2002 0:00
10/30/2002 0:00
11/2/2002 0:00
11/3/2002 0:00 Please note that some of the dates are missing the query.
The second set of query is ------
"select SnapshotDate
from tabelname
where snapshotdate >= '10/25/2002 00:00:00'
group by snapshotdate"
The results from the above query is----
10/25/2002 0:00
10/26/2002 0:00
10/27/2002 0:00
10/28/2002 0:00
10/29/2002 0:00
10/30/2002 0:00
10/31/2002 0:00
11/1/2002 0:00
11/2/2002 0:00
11/3/2002 0:00
11/4/2002 0:00
11/5/2002 0:00 please note that results with all the dates.
Please, kindly help me to resolve this unexpalinable thing.
Thanks,