I have the following query and it's result is not according to my expectation.
SELECT PaymentTerms, VendorCode , count(HeaderId) FROM Tbl_FPOHeader
GROUP BY PaymentTerms, VendorCode
Both PaymentTerms, VendorCode are NVarchar(50) and HeaderId is int type.
I want the result to be sorted by PaymentTerms, but the result is Vendorcode.
If i use Order By PaymentTerms it is working fine, but I would like to get by using group by only.
Please help.
Thank you.
HI,
data in entities is just an unordered set of data unless you use an order statement. So you will have to use an order by clause. if not you might or might not get the results (by accident :-) ) in the prefered order.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de