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 2005 Forums
 Transact-SQL (2005)
 Query and View

Author  Topic 

kickapoo
Starting Member

7 Posts

Posted - 2011-06-09 : 00:47:16
Hi im sharon...i would like to ask about sql query and view:

see i have a database which has the table has a of data :
name date timein timeout
sharon 10/12/2011 8:30 5:35


what i would like to show on my query/view would be maximum and minimum time and the time in and time out will separated in to two
rows like the sample below:

name date timein
sharon 10/12/2011 8:30
sharon 10/12/2011 5:35

is it possible?

thanks

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-09 : 07:12:27
For your test date, this would work:

select
name, date, timein
from
yourTable
union all
select
name, date, timeout
from
yourTable
But, I am almost positive that that is not what you are looking for - that this will not give you the right results for your real data. Can you post more representative sample data and give the corresponding expected output?
Go to Top of Page
   

- Advertisement -