SQLTeam.com | Weblogs | Forums

Query help

sql2008
sql2012

#1

Hi I need to establish when first Purchase Order was placed
Here is my columns and table
How can I group them by document number and min date?

SELECT
[Document No_]
,[No_]
,[Order Date]
FROM [TBW_BI].[dbo].[Dreams house$Purchase Line]

when I run normal execute this how it is coming where in date column i have dates not 00 .

UKTFRPLT118 57286-0 00:00.0


#2
SELECT
[Document No_]
,[No_]
,Max([Order Date]) MaxOrderDate
FROM [TBW_BI].[dbo].[Dreams house$Purchase Line]
GROUP BY [Document No_]
,[No_]

#3

thank you