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.
| Author |
Topic |
|
1sabine8
Posting Yak Master
130 Posts |
Posted - 2010-01-25 : 05:02:38
|
| Hi,I need some help in a query i'm trying to build.I have table customers and table tickets linked by the customer id and each customer can have many tickets.In the table ticket we have the date the customer bought the ticket.I need to have as result of my query the last date (most recent date) each customer bought a ticket.EX: Customer A 1-1-2010 Customer B 3-1-2010How can this be done?thanks in advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-01-25 : 05:29:26
|
SELECT Customer, MAX(OrderDate) AS RecentDateFROM Table1GROUP BY Customer N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|