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 |
|
eem_2055
Yak Posting Veteran
69 Posts |
Posted - 2007-12-14 : 01:02:14
|
| Hi guys!I merely need your help!I want to convert the following:Table1transaction Date1235 10/18/2006 7:54:021235 9/18/2006 7:54:021235 8/18/2006 6:54:02ToTable2 wherein the latest date will be post and the date should have a length of 10 characters. The following table would be the resulttransaction Date1235 10/18/2006 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-14 : 01:20:14
|
| Select [transaction], max([date]) as [date] from tablegroup by [transaction]If you use front end application, do date formation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2007-12-14 : 03:41:57
|
| Also use CONVERT() on the date, all the information you need is in BOL. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-12-14 : 04:15:31
|
quote: Table2 wherein the latest date will be post and the date should have a length of 10 characters
why are you using char/varchar to store data time ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|