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)
 Sql Query

Author  Topic 

govind_ind12
Starting Member

5 Posts

Posted - 2010-08-06 : 05:51:37
I have value below like this in my SQL Table

UID Name ECode Edescription Keys Date
23 Raja 1 KeyTaken 11 08/04/10 10:40 AM
23 Raja 1 Key Taken 11 08/04/10 11:05 AM
23 Raja 2 Key Return 11 08/04/10 12:10 PM
23 Raja 2 Key Return 11 08/04/10 12:25 PM

I want output like below, please anybody give me query

UID Name Edescription Keys Taken Time Edescription Keys ReturnTime
23 Raja Key Taken 11 08/04/10 10:40 AM Key Return 11 08/04/10 12:10 PM
23 Raja Key Taken 11 08/04/10 11:05 AM Key Return 11 08/04/10 12:25 PM

Please any one can help me to do this.

Govind

Sachin.Nand

2937 Posts

Posted - 2010-08-06 : 07:29:52
Your date does not make sense.How is it possible that Raja takes key at "2010-08-04 10:40:00.000" & before he returns it he again takes key at "2010-08-04 11:05:00.000".Then he returns the key at "2010-08-04 12:10:00.000".

So how does one know which key he returned at "08/04/10 12:10 PM"??? the one he took at "2010-08-04 10:40:00.000" or the one he took at "2010-08-04 11:05:00.000".
Do have any column called "keyid" or something like that which differentiate between different keys.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page
   

- Advertisement -