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 |
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2007-04-09 : 01:30:16
|
| Hi to all the SQL Gurus,I have a table where dates are stored in single column.Actually the application is a leave application where the the datestaken by an employee is saved.The format is like thisPid dates7 12/05/20077 13/05/20077 14/05/20077 15/05/20078 10/06/20078 11/06/2007 and so onWhat I want is that at the front end the data should be displayed in the form ofFrom date To Date 12/05/2007 15/05/2007 for Pid 710/06/2007 11/06/2007 for Pid 8 & so onAny ideas on how to acheive it? Regards,Sachin |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-09 : 01:36:37
|
[code]select Pid, min(dates), max(dates)from yourtablegroup by Pid[/code] KH |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2007-04-09 : 02:26:23
|
| Man that was fast.Hats of to you khtan.Thanks |
 |
|
|
|
|
|