PDA

View Full Version : Solved: Problem With Select Query



kbsudhir
05-23-2009, 07:02 AM
Hi All,

I am using a select query as per the criteria.
The data which I have in the table is in the attachment.

Below is the query which I am using to get the data.

SELECT PChange.ReqNo, PChange.ItemNo, PChange.Code, PChange.Cost1, PChange.Cost2, PChange.Cost3, PChange.Cost4, PChange.DateStart
FROM PChange
WHERE (((PChange.ReqNo)=1))
GROUP BY PChange.ReqNo, PChange.ItemNo, PChange.Code, PChange.Cost1, PChange.Cost2, PChange.Cost3, PChange.Cost4, PChange.DateStart;


But I am not getting the complete data i.e all 5Lines of data.

I am only getting the 4Lines of data as given as provided in the attached.

What could be the reason behind this. I am complete data.

Please guide.


:doh: :doh:


Regards
Sudhir

OBP
05-23-2009, 10:03 AM
Probably because you are using Group By on the date start column
The missing record (record 2) has the same values as record 1 so it has grouped them by the same data for all fields.
Why are you using Group By if you want to see all of the records?

kbsudhir
05-23-2009, 10:59 AM
Well, this is known as foolishness.

Thanks man for pointing this out.

Regards
Sudhir