SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Half hour should not exceed 30 m
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

techfortune
Starting Member

India
1 Posts

Posted - 03/18/2014 :  01:31:38  Show Profile  Reply with Quote
Dear sir,

Please see below control panel statics,

cp start_time stop_time
2 15-03-2014 23:58 15-03-2014 23:57
1 16-03-2014 01:11 15-03-2014 23:57
2 16-03-2014 01:09 15-03-2014 23:58
3 15-03-2014 23:59 15-03-2014 23:59

I want to write sql statement which will return result only for every 30 mins.

For. example -
SELECT id, CP,, Start_Time, Stop_Time FROM tablename WHERE (Stop_Time BETWEEN '2014-03-15 23:30:00.000' AND '2014-03-15 23:59:59.000')

Please suggest asap.

Regards,
TFS

TFS

Edited by - techfortune on 03/18/2014 01:39:41

ahmeds08
Aged Yak Warrior

India
643 Posts

Posted - 03/18/2014 :  08:21:41  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
SELECT id, CP,, Start_Time, Stop_Time FROM tablename
where DATEDIFF(Minute, '2014-03-15 23:30:00.000', '2014-03-16 00:00:00.000')=30

Javeed Ahmed
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000