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 |
|
jszulc
Yak Posting Veteran
66 Posts |
Posted - 2008-03-30 : 14:16:31
|
| I would like to show when leads updated last their records in database. An automated report that tells me when the last date was that the leads updated an entry, only 1 entry per lead.select Lead,LastUpdated from dbo.KPITblI have a table with data that looks like this:Lead LastUpdated----------- -----------------------JOHN SMITH 2008-03-26 08:45:00JOHN SMITH 2008-03-20 09:33:00MEG RYAN 2008-02-21 16:16:00JOHN SMITH 2008-02-21 16:19:00MEG RYAN 2008-02-21 16:22:00JOHN SMITH 2008-03-28 16:10:00JOHN SMITH 2008-03-28 08:49:00JOHN SMITH 2008-03-23 19:23:00MARK MCRAE 2008-03-27 03:12:00MARK MCRAE 2008-03-26 08:48:00MARK MCRAE 2008-03-26 08:46:00JOHN SMITH 2008-03-26 08:47:00JOHN SMITH 2008-03-26 08:48:00ALLAN WHITE 2008-03-26 08:43:00ALLAN WHITE 2008-03-26 08:40:00JOHN SMITH 2008-03-26 08:48:00Thank you appreciate it. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-30 : 14:19:01
|
| select Lead, max(LastUpdated) as LastUpdated from dbo.KPITblgroup by Lead_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
jszulc
Yak Posting Veteran
66 Posts |
Posted - 2008-03-30 : 14:29:16
|
| Works great, Thank you! |
 |
|
|
|
|
|