SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 22nd, 2004, 12:30 AM
Mohan G Mohan G is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Mohan G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i need some help in SQL server 2000 Query

i am doing a real time project. in that i need an sql query. plase go through the data in the table and help me to get the result.

Data in the table is :



BulbNo State ChangeTime

2 OFF 19/08/2004 21:23:10
2 ON 19/08/2004 21:22:10
2 OFF 19/08/2004 21:20:10
4 ON 19/08/2004 21:18:50
4 OFF 19/08/2004 21:17:00
7 OFF 19/08/2004 21:13:30
7 ON 19/08/2004 21:12:50
7 OFF 19/08/2004 21:12:40
9 ON 19/08/2004 21:12:30
9 OFF 19/08/2004 21:11:00
10 ON 19/08/2004 21:12:30
10 OFF 19/08/2004 21:11:00
2 ON 19/08/2004 20:22:10
2 OFF 19/08/2004 20:20:10
5 ON 19/08/2004 20:12:30
5 OFF 19/08/2004 20:11:00
7 ON 19/08/2004 20:12:50
7 OFF 19/08/2004 20:12:40
9 ON 19/08/2004 20:12:30
9 OFF 19/08/2004 20:11:00

The result I am expecting is like this :
To show the Previous and the Present states of each bulb, with its state change timings and the time diff. between these States

B.No Cur. State Cur. Time Prev. state Prev. Time Time Diff.(in sec.)

2 OFF 19/08/2004 21:23:10 ON 19/08/2004 21:22:10 60
4 ON 19/08/2004 21:18:50 OFF 19/08/2004 21:17:00 110
5 ON 19/08/2004 20:12:30 OFF 19/08/2004 20:11:00 90
7 OFF 19/08/2004 21:13:30 ON 19/08/2004 21:12:50 40
9 ON 19/08/2004 21:12:30 OFF 19/08/2004 21:11:00 90
10 ON 19/08/2004 21:12:30 OFF 19/08/2004 21:11:00 90

thanx in adv.

Mohan G

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > i need some help in SQL server 2000 Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT