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 2000 Forums
 Transact-SQL (2000)
 "Hopefully Simple date problem"

Author  Topic 

sjamesje
Starting Member

7 Posts

Posted - 2004-03-11 : 18:06:08
I have a table with a series of store numbers and associated date ranges per store. I simply need to write a query that will pull only the last day from each store number. What would be the best way to do that?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-11 : 18:11:46
SELECT StoreNumber, MAX(DateTimeColumn)
FROM Table1
GROUP BY StoreNumber

Tara
Go to Top of Page

sjamesje
Starting Member

7 Posts

Posted - 2004-03-12 : 10:22:30
Thank you!!!
Go to Top of Page
   

- Advertisement -