Adding Half Hour Intervals To Time

Oct 6, 2014

I have data that looks like the following.

ID Date Time Length Interval_Num
1 10/11/2014 9:00 420 14

Basically, length represents the # of minutes a person is scheduled for. We have 30 minute intervals. Interval_Num = (Length/30). I need the data to show each interval. For the above example it should only be 14 intervals.For the above example the solution should look like....

ID Date Time Length
1 10/11/2014 9:00 30
1 10/11/2014 9:30 30
1 10/11/2014 10:00 30
1 10/11/2014 10:30 30

for 14 intervals up until 16:00

View 4 Replies


ADVERTISEMENT

How To Convert A Time-stamp To Half-hour?

Nov 16, 2007

I would like to make a function to convert a datetime to half-hour. E.g. If the timestamp is 1:23:05 then converts to 1:30:00, if 1:35:27 then converts to 2:00:00.

Anyone has any idea? Thanks.

View 4 Replies View Related

Transact SQL :: Split Half Hour In Number From String

Jun 11, 2015

How I can split the half hour in number from this string?
 
20130329070000 (it's varchar)
Easy for the date
cast (left(20130329070000,8)as date)

I can achieve even the Half Hour

select
left(SUBSTRING('20130329070000',9,4),2)+':'+RIGHT(SUBSTRING('20130329070000',9,4),2)

But what I need is the Half Hour in numeric format, so 00:00

should be 1, 00:30 should be 22, 01:00
should be 3, 01.30 should be 4......23:30 should be 24.

I already did but I can't find the piece of code I used.

View 5 Replies View Related

After Set New_broker, It Works For Half Hour And Don;t Work Anymore, Please Advise, Thanks!

Sep 10, 2006

I use ASP.NET 2.0 and SQL 2005, the SQLCacheDependency didn't work stable for me, it usually works and after a while, it stops working. Recently, It doesn't work. Today I reset service broker by

Alter DB set new_broker

It seems all work, but too early to be happy, it doesn't work now anymore. I don't see any record in

sys.transmission_queue

And I don't see new entries in

sys.dm_qn_subscriptions neither when I modify a record which bind to SQLCacheDependy.

I see some errors in log like


Message
The query notification dialog on conversation handle '{8F8CC642-6340-DB11-8F09-0014227B7B80}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service &apos;SqlQueryNotificationService-f79776f7-9ca5-4c5f-8a66-0d81f7673683&apos; because it does not exist.</Description></Error>'.

Any idea how to find out the problem?

thanks!

View 1 Replies View Related

Calculate Time Worked By 15 Min Intervals.

Dec 19, 2007

Ok, I know that there is a very smart programmer out there that can resovle my issue.

I am trying to calculate time worked by 15 minute intervals.

Example:
Emp 1 started work at 13:00:00 and worked 183 minutes
Emp 2 started work at 17:15:00 and worked 150 minutes
Emp 3 started work at 08:30:00 and worked 17 minutes

I need to show the following results:

time employee #of_min_worked
----------------------------------------------
08:30:00 3 15
08:45:00 3 2
09:00:00
08:30:00
08:45:00
09:00:00
09:15:00
09:30:00
09:45:00
10:00:00
10:15:00
10:30:00
10:45:00
11:00:00
11:15:00
11:30:00
11:45:00
12:00:00
12:15:00
12:30:00
12:45:00
13:00:00 1 15
13:15:00 1 15
13:30:00 1 15
13:45:00 1 15
14:00:00 1 15
14:15:00 1 15
14:30:00 1 15
14:45:00 1 15
15:00:00 1 15
15:15:00 1 15
15:30:00 1 15
15:45:00 1 15
16:00:00 1 3
16:15:00
16:30:00
16:45:00
17:00:00
17:15:00 2 15
17:30:00 2 15
17:45:00 2 15
18:00:00 2 15
18:15:00 2 15
18:30:00 2 15
18:45:00 2 15
19:00:00 2 15
19:15:00 2 15
19:30:00 2 15
19:45:00
20:00:00
20:15:00
20:30:00
20:45:00
21:00:00
21:15:00
21:30:00
21:45:00
22:00:00
22:15:00
22:30:00
22:45:00
23:00:00
23:15:00
23:30:00
23:45:00

View 1 Replies View Related

Subscribing Report For Time Intervals

Mar 5, 2008

Hi there,

Is there anyway of subscribing to a report to run for every 1 hour between the times off 9am to 5pm only ?

I cant seem to find the ability to set time intervals anywhere

View 1 Replies View Related

Convert To Irregular Time Intervals

Feb 9, 2008

I have a client that collects data from a manufacturing facility a one minute intervals. I already have sql statments to convert the 1 minute data to other timeframes (e.g. 30 min, 60 min, daily). However, now the client wants to look at data converted to irregular time intervals. For example, instead of looking at the first, second, third, etc. 60 minutes of a day, they wish to see data grouped irregularly: first 30 minutes, next 1 hr & 45 min, next 2 hours, next 1 hr & 30 min, etc. These irregular intervals could change; they may later want to look at the first hr, next 2 1/2 hrs, next 1/2 hour, etc.; or whatever strikes their fancy.

So far, all I've come up with is run one query for each desired time session and then do a join on all the resulting tables. Anybody have a better idea on how to do this?

View 1 Replies View Related

SQL Server 2008 :: Time Differences Between Different Intervals?

Apr 30, 2015

how can I get the time differences between them.Let's say , a person who click on break @ 12:00 PM and he is back and select I am back option @ 12:15 the total break time is 15 minutes. However, can I display this difference of break time.

View 4 Replies View Related

Rond Time Down To Hour

Aug 5, 2007

I want to round times down to the previous hour,
For example a call time of 7/31/07 11:51:13.532 would become 7/31/07 11:00:00.000.

View 14 Replies View Related

Gurus Help!! How To Sort By Hour And By Day Of Time?

Jan 21, 2005

I need to query data from a table which has order_date which is datetime field. How to pull orders by hour by day per month for the last 4 months. Any idea how to write the query?

Sample data:

order_dt order_no
2004-02-04 18:18:19.800 100
2004-02-04 18:18:22.677 101
2004-02-05 06:30:23.300 102
2004-02-05 06:31:39.533 103
2004-02-05 06:32:45.377 104

View 6 Replies View Related

24 Hour Format And Current Time

Sep 3, 2014

if now the system time is 2014-12-23 23:45:345 . then I want to calculate the sales amount with total and get current date and current hour filter by hh:00-hh:59 , my desire output is like below :

Current time:23:50 run this query
Date Time amount
2014-12-23 23:40 $10
2014-12-23 23:01 $5
2014-12-23 23:39 $5
Total :$20

View 1 Replies View Related

Time Interval For Hour And 30 Minutes

Sep 4, 2007

Time Interval for hour and 30 minutes
--------------------------------------------------------------------------------

Hi Everyone

I Have column in sql server databas as "HHMMSS" and data as and i am doing a substring to get values for hours and minutes. since my calculations based on hour interval and 30 minutes interval


for ex: Now i want to show all the transaction done b/w 6 to 7 am or pn.

and for 30 minutes interval i have get the calculation as transactions done b/w 6:00 to 6:30 and 6:30 to 7:00 either it's am or pm. now how i can write my sql statements that calculates hour and 30 minutes intervals
HHMM
-------------
06:43
09:26
09:26
11:58
12:25
18:17
20:45
00:43
00:53
16:47


Thanks
Phani

View 7 Replies View Related

Convert Time To 24 Hour Clock

May 30, 2007

All ,



I need to convert the given time into 24 hour clock .



I have the two tables out of which one contain time in 12 Hr clock and another contain time in 24 Hr clock and i need to make a join on this colum by converting 12 Hr time in to 24 hr clock time.





Please help ..





Regards,

Ashish

View 16 Replies View Related

How To Find The Hour Of A Date Time

Oct 22, 2007

i have a query i need to calulate the HH of a datetime field

example


Dateval Need to get







10/01/2007 7:48
10/01/2007 7:00

10/01/2007 7:49
10/02/2007 7:00

10/01/2007 7:50
10/03/2007 7:00

10/01/2007 7:51
10/04/2007 7:00

10/01/2007 7:52
10/05/2007 7:00

10/01/2007 7:53
10/06/2007 7:00

10/01/2007 7:54
10/07/2007 7:00

10/01/2007 7:55
10/08/2007 7:00

View 5 Replies View Related

Summing Time Span (for Total Per Hour)

Sep 12, 2013

field prodDate puts out values as such:

8/12/2013 7:50:15
8/12/2013 7:51:03
8/12/2013 7:53:42
8/12/2013 7:54:12
8/12/2013 7:56:02
...
...
8/12/2013 14:57:57
8/12/2013 14:59:59

I'd like to get a time span sum beginning with the first prodDate entry and ending with the last.

The idea is I'll then use that to divide lbs produced, thus giving me a gauge for lb per hour.

View 3 Replies View Related

Converting Varchar Time HHMM To 24 Hour HH:MM:SS?

Oct 29, 2014

How can I do this? I have a column that is a varchar and times are stored like this:

0600
1240
0145
2335

How can I get those to HH:MM formats? I've tried this but I don't know if it's the best way, plus there are seven 0s after the MM:

convert(time,LEFT(b.status_time,2) +':'+ RIGHT(b.status_time,2))

View 2 Replies View Related

Reporting Services :: Round Time To Quarter Hour

Jun 2, 2011

SSRS 2008 R2. I am writing a report that uses a DB4 database. Because of this many SQL commands that I normally use are not available and I don't know what commands I can use. Because of this I am doing much of my calculations inside of SSRS.

I need to round a time field to the nearest quarter hour inside of SSRS.

For example:
8:12 becomes 8:15
2:30 becomes 2:30
1:57 becomes 2:00
4:07 becomes 4:00

View 9 Replies View Related

SQL 2012 :: How To Backup Half Of DBs From A Server On C Drive And Other Half On D Drive

Jan 16, 2015

How to backup half of dbs from a server on C drive and the other half on D drive and vice versa, first half on D drive and other half On C drive using only one job and one stored procedure??

Using scheduling from job add 2 schedules to the job so first schedule backup first half to C and second half to D , the second schedule backup first half to D and second half to D.

View 1 Replies View Related

I Have A Web Site Where I Input Stories And Set The Publish Date To Some Time In Future And Set An Hour From 1-24....

Sep 20, 2007

i need to be able to do an sql call whereby i can check the day and hour for publishing.eg select story where day = ?? AND hour = ?? any one know the best way to do this.
i need to call out date as a day number or someting and the getdate as just the hour??? anyone know how??

View 1 Replies View Related

Power Pivot :: Calendar Look Up Table - Custom 24 Hour Start Time

Jul 9, 2015

I know how to do this in Excel, but not sure about Power Pivot. Our fire department works on a 24 hour shift that starts at 0700 each morning. I want to look up what shift is working depending on the date and time of dispatch. In Excel, I would do a look up table, but instead of using false() as  the last parameter, I would choose true().

I am not sure if this would be best created as a calculated column in the table that holds the incident date and time values, or have a separate table and create a relationship to use the shift in the rows/columns of my pivot table. 

View 6 Replies View Related

Going From 15 Minute Intervals To 1 Min Intervals?

Jun 3, 2015

I have two fields ID and Log data and log data is a 96 character long string of numbers representing 15 minute intervals from midnight to midnight.

I need to convert these 96 characters to a full 1440 characters which would mean taking each of the 96 characters one by one and making 1 character into 15.

I had Vb macro to do the conversion but now it's broken and I can't fix it. Getting it done in SQL would solve a lot of problems.

I then go from the 1440 fields and do log analysis like total time doing a specific activity but my query is dependent on having all 1440 characters.

View 3 Replies View Related

Counting Popularity, Hour By Hour

Nov 14, 2001

I have a table that is recording hits to a website. Everytime someone views a page, the datetime of the hit is recorded in a field called hit_date_time. I would like to be able to come up with a query that will show how many hits occured on a given day or given days, broken down by hour.

The resulting table for two days would look something like:
Time Hits
1/1/01 12:00 1
1/1/01 1:00 23
1/1/01 2:00 54
1/2/01 1:00 15
1/2/01 2:00 14

I can't seem to figure out how to write the query so that I can take into consideration the date and hour of the event so that I can count it.

Thanks,

Eron

View 2 Replies View Related

Adding Milliseconds To Time

Nov 19, 2004

Hi,
i am trying to add milliseconds to a time. For example if i have a time of 01:01:05:000 and i want to add 0.297 milliseconds to it i use the following simplified query


SELECT CONVERT(nvarchar(20), DATEADD(ms, 0.297, '00:01:05:000'), 14) AS Expr1


However instead of getting 01:01:05:0.297 i get 01:01:05:000. Can somebody please tell me what i am doing wrong.

Thanks in advance.

View 4 Replies View Related

Adding Milliseconds To Time

Nov 19, 2004

Hi,
i am trying to add milliseconds to a time. For example if i have a time of 01:01:05:000 and i want to add 0.297 milliseconds to it i use the following simplified query


Code:


SELECT CONVERT(nvarchar(20), DATEADD(ms, 0.297, '00:01:05:000'), 14) AS Expr1



However instead of getting 01:01:05:0.297 i get 01:01:05:000. Can somebody please tell me what i am doing wrong.

Thanks in advance.

View 2 Replies View Related

Adding Time To Rank

Feb 27, 2004

Using FoodMart, how can i add time to this:

WITH MEMBER [Measures].[Rank] AS 'Rank ( Product.CurrentMember,Order( {Product.CurrentMember.Parent.Children} ,[Profit], DESC) ) '
SELECT
{[Profit] , [Rank]} ON COLUMNS,
Drink.Children ON ROWS
FROM Sales

View 2 Replies View Related

Adding Time Totals In SQL

Dec 12, 2005

I am trying to get a total for times, but I am having trouble gettinganything to work. Basically I created a query to pull up severalpeople's name that performed certain details and how long each detailwas. I now want to add up all the hours to a total for each person. Cananyone point me in the right direction?*** Sent via Developersdex http://www.developersdex.com ***

View 2 Replies View Related

Adding Columns With Different Time Unit

Oct 29, 2014

I have three different columns, hour(s), min(s), sec(s)

I can add it up, but will like to convert it into. hrs, mins and sec.

this is how, i am adding it up into seconds.

SELECT ((TotalTimeSpentHrs*60*60)+(TotalTimeSpentMin*60)+(TotalTimeSpentSec))AS totaltime
FROM EST1

How can I convert the total seconds, so that i can input the result in a new column.

View 1 Replies View Related

Adding A Time Stamp To The Records

Jul 20, 2005

I have a shopping cart that will get full from time to time becausecustomers click out of the site before they confirm their purchase,therefore leaving a full cart behind. I'd like to have a timestamp onthis table, so that I can delete anything that I find is more than a dayold.How can I do this?Thanks,Bill*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 1 Replies View Related

Adding Entry To DB And Getting Unique ID At The Same Time

Jul 20, 2005

Hi all,I'm writing a website with Cold Fusion and when a user submits arequest and it's stored in the MS SQL database, I want the unique ID(Identity field in table) to be given to the user on screen plusemailed to user.Now can I store data to the database (where the ID is created) andreturn this as a variable in the same statement? I've seen this doneon many websites, but I have no idea how to do it in one step.Thanks,Alex.

View 1 Replies View Related

Adding Integer Value To Date Time

Aug 4, 2015

I am trying to add integer value to the datetime to get the configurable "date".But it is not working out. Here is the code for it.

declare @Id int;
exec @Id = up_GetConfigurableDayInterval
print getdate() + @Id

The sp "up_GetConfigurableDayInterval", will return number of days to add the the current date time. But print getdate() + @Id , is not producing the updated result.But when ever i have replaced the variable "@Id" with a value, Say "5", it is producing the expected result.I have also tested the above code by the following:-

create table Temp(value datetime);
insert into Temp values(getdate() + @Id);
select * from Temp

But it is not having the new added datetime.

View 12 Replies View Related

Adding The Same Column To A Model More Than One Time

Jan 11, 2007

I know that I can add a column to a mining structure and/or model more than once using XMLA.  However, I am having a problem doing the same using DMX.  I now that DMX does not support data binding and that it relies on the INSERT INTO... construct to essentially map the structure columns to the incoming comluns from the data source.  I tried to use "AS" like I would in SQL but it doesn't seem to like it. 

Can anyone confirm that this can only be done using XMLA and not DMX?  If I am mistaken, it would be greatly appreciated if you could provide  an example on how to do this using DMX.

For background on why I would want to add the same column to a model more than once please read this post.

Thanks.

View 3 Replies View Related

Adding Date And Time To Backup File???

Oct 30, 2006

Hello all. I was just wondering how I could add the current date and time to the name of the .bak file. I perform a full backup daily and would like to keep a weeks worth of backups, but everytime I run the job, it just overites the previous one.

The command in the wizzard is:

BACKUP DATABASE [snl] TO DISK = N'C:Backups_for_FTPSNL_Full.bak' WITH NOINIT , NOUNLOAD , NAME = N'snl backup', SKIP , STATS = 10, DESCRIPTION = N'SNL Backup', NOFORMAT

Thanks,

Parallon

View 2 Replies View Related

Adding Hours Between Each Time Block Stored In A Database?

Feb 26, 2013

I am trying to add the hours between each time block stored in a database.

In this database a user enters the begin time and the end time. For example the course MATH0001 would start at 8am and end at 10am. Therefore the user would enter 0810 in the start field and 1000 in the end field. The course MATH0001 doesn't run the entire semester it may only run from 8th Jan - 15th March and the course is scheduled in a room called GR4. Now because a course can be scheduled modularly, one room could have several courses scheduled in this manner.

The problem: I need to find out how many hours GR4 is used but it contains the following courses

Code:
Schedule for room called GR4
Course StartDate EndDate BeginTime EndTime HoursPerClass
MATH0001 06-FEB-13 19-FEB-13 0810 1700 9
MATH0002 20-FEB-13 04-Mar-13 0810 1700 9
MATH0003 10-JAN-13 05-Feb-13 0810 1700 9
MATH0004 22-APR-13 17-May-13 0810 1700 9
MATH0005 08-MAR-13 21-APR-13 0810 1700 9
MATH0006 07-JAN-13 09-JAN-13 0910 1300 4
MATH0007 20-JAN-13 17-MAY-13 1710 2000 3
MATH0008 08-JAN-13 18-JAN-13 1710 2000 3

A day only has 13 hours. Therefore the total hours spent in GR4 should be 12 hours. This is calculated by adding the hours between 8am and 5pm = 9 hours and 5pm an 8pm = 3 hours. I would not include 9am to 1pm because it is a subset of the 8am to 5pm slot.

Now, how to accomplish this but below is the code that i have thus far:

I forgot to mention that this code was to just test my 'final code' results and it outputs the table shown above. Anyway for testing purposes I have limited the search to the room GR4 and the day Tuesdays.

Code:
select DISTINCT ssrmeet_room_code,
ssrmeet_start_date,
ssrmeet_end_date,
ssrmeet_crn,
ssrmeet_begin_time,
ssrmeet_end_time,
(((CAST(M.SSRMEET_END_TIME AS INT))-(CAST(M.SSRMEET_BEGIN_TIME AS INT)))+10)/100 As HoursPerClass,

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved