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
 General SQL Server Forums
 New to SQL Server Programming
 Generate 5 minute intervals

Author  Topic 

squidward
Starting Member

2 Posts

Posted - 2008-01-28 : 09:39:57
Hello
Probably a very simple problem, but im stumped. I have a table which gives the start-time and end-time of an employees work day. I want to create a view which contains a line of data for each 5 minute period worked. Please help.

X002548
Not Just a Number

15586 Posts

Posted - 2008-01-28 : 09:57:18
Not for nothing, but that sounds unreasonable

Can you tell us why you want to do this?

I'm sure we can come up with a solution



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-01-28 : 10:00:33
I am bored...
SELECT		CONVERT(CHAR(5), DATEADD(MINUTE, 5 * Number, '19000101 00:00:00'), 108),
CONVERT(CHAR(5), DATEADD(MINUTE, 5 * Number, '19000101 00:04:00'), 108)
FROM master..spt_values
WHERE Type = 'p'
AND Number < 288
ORDER BY Number



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

squidward
Starting Member

2 Posts

Posted - 2008-01-28 : 10:07:22
Hello
I need a view with 5 minute intervals of the working day to allow me to assign different overtime rates for different periods. I have 5 different overtime rates to apply (1.25, 1.5, 1.75 and 2.0. The only input I receive is 'Start time' and 'End time'. I figured if I had each 5 minute period I could set each rate for each specific 5 minute chunk. Our guys work various weird hours, overlapping the various overtime rates.
Go to Top of Page
   

- Advertisement -