Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 group by

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-10-13 : 02:40:22
i have sample data:

ProductCd	DateS	          TimeS
a 20100102 11
a 20100102 9
b 20100101 10
b 20100101 9
a 20100101 10
i want to get for each product,his max date and the max hours for that date.

ProductCd     DateS        TimeS
a 20100102 10
b 20100101 10

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-10-13 : 02:50:26
The "TimeS"-column...it looks a little crooked. Is it one or two columns?

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-10-13 : 03:20:09
is it ok,now?

TimeS (mean the hour,like 10AM,11AM,9AM..)
Go to Top of Page
   

- Advertisement -