Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
HelloProbably 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.
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_valuesWHERE Type = 'p' AND Number < 288ORDER BY Number
E 12°55'05.25"N 56°04'39.16"
squidward
Starting Member
2 Posts
Posted - 2008-01-28 : 10:07:22
HelloI 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.