T-SQL (SS2K8) :: Merging Intervals With Identical Data

Jul 10, 2014

I'm having issues building a cte sql statement for merging intervals. I have a table with data as follows:

declare @table table
(
startpoint int,
stoppoint int,
value int
[Code] ....

The resulting query returns the rows in the table, sorted by startpoint:

startpoint stoppoint value
----------- ----------- -----------
0 10 1
10 15 1
15 25 2
25 30 2
30 40 2
40 55 3
55 60 3
60 80 2

I'm looking for a merge cte that returns consecutive intervals with the same value, as follows:

startpoint stoppoint value
----------- ----------- -----------
0 15 1
15 40 2
40 60 3
60 80 2

View 3 Replies


ADVERTISEMENT

T-SQL (SS2K8) :: Populating Data By Date Intervals

Mar 6, 2015

Table Name: EmployeeDetails
Columns: EMpID - Date - WorkedHours

For each day I get details of number of hours worked by each employee in this table.

Now my HR wants a report with such columns

empid - Week - Month - Qtr

So, week will have Sum of hours worked by employee in that week
Month will have Sum of hours worked by employee in that Month
Qtr will have Sum of hours worked by employee in that Qtr

View 6 Replies View Related

T-SQL (SS2K8) :: Scrub Data In 5 Minute Intervals

Nov 2, 2015

I have a situation where I have table with over a billion records and needs to be scrubbed. Table does have a field with date time timestamp. I have been deleting rows from the table using the script below which basically provides me delete statements by date for records older than 90 days.

But now on each day row count is over 30 million rows and it takes forever to delete by date and transaction log becomes humongous.

So I would like to scrub it in 5 minute intervals instead of daily for records older than 90 days. Even in 5 minute intervals the record count tends to be around a million. This will keep the delete slice small enough to not a gigantic transaction log.

declare @startdate Datetime
declare @enddate Datetime
set @startdate = getdate()-480
set @enddate = getdate()-90

--set @vStart = select convert(varchar,@startdate, 102)

print @startdate
print @enddate

WHILE (@startdate < @enddate)
BEGIN
print 'delete from vending where DetectedDate < ''' + CONVERT(varchar(10), @startdate, 101) +''''
set @startdate = @startdate+1
END

I am hoping to modify the script above to produce a script with statements like this for a window between last 90 and 120 days:

delete from vending where DetectedDate <'6/15/2015 8:25:00 PM'
go
delete from vending where DetectedDate <'6/15/2015 8:30:00 PM'
go
delete from vending where DetectedDate <'6/15/2015 8:35:00 PM'
go

View 2 Replies View Related

T-SQL (SS2K8) :: Merging Non Overlapping Timedates

Sep 17, 2014

Using SQL 2008 R2 and stuck on this.

I have several sets of timedate ranges and I need to merge the ranges where there is no overlap with the jobs on resource1. In my example data, I want all jobs from ResourceID 1 and those jobs from all other resources where they do not overlap with EXISTING jobs on resource 1 (i.e. imagine I'm trying to select candidates from other resources to fill ResourceID 1 with continuous jobs)

Below is some sample data, my failed attempt and expected results. I managed to excluded everything that should be excluded except job 10

-- Need to select all other jobs from all other resources that can be merged into resource 1 where there is no overlap with existing jobs in resource 1 only

CREATE TABLE #Jobs
(
resourceID INT
,JobNo INT
,StartTime SMALLDATETIME
,EndTime SMALLDATETIME
,ShouldBeOmitted BIT

[Code] ....

View 8 Replies View Related

T-SQL (SS2K8) :: Merging Pseudo Duplicate Records

Apr 21, 2014

We have a data warehouse staging database in which we capture change history for hundreds of tables from a source system. In the source system, records are updated in place, but in our data warehouse we capture these changes by "terminating" the existing record and adding a new record reflecting the changes. In the data warehouse we add two columns to every table -- effective_date and expiration_date -- which indicate the dates the record was in effect in the source system. By convention, an expiration_date of 6/6/2079 means the record is currently still active in the source system. Each day we simply compare yesterday's version of the record (in the data warehouse) against today's version (in the source system). If differences are found in any of the columns, we terminate the record and add a new one, setting those dates appropriately.

In this example, the employee_id column is the natural key in the source system. We add the effective_date and expiration_date in the data warehouse, so those three columns together make up the key in the data warehouse. The employee_name, employee_dept, and last_login_date columns all come from the source system as well.

drop table mytbl
create table mytbl (
effective_date smalldatetime,
expiration_date smalldatetime,
employee_id int,
employee_name varchar(30),

[code]....

In the select output, you can follow the trail of changes for each of these three employees. Bob moved from dept 7 to 8 at some point; Frank didn't change departments at all; Cheryl moved from dept 6 to 9 and later back to 6. However, the last_login_date was updated frequently for all these employees.

We've tracked hundreds of tables this way for years, some with hundreds of columns. For optimization purposes, I'm now interested in trimming the fat a bit. That is, we track changes in many columns that we don't really need in our data warehouse. Some of these columns are rapidly-changing, causing all sorts of unnecessary terminate/inserts in the data warehouse. My goal is to remove these columns, reclaim the disk space and increase the ETL speed. So in this example, let's get rid of the last_login_date column.

alter table mytbl
drop column last_login_date
select *
from mytbl
order by employee_id, effective_date

Now in the select output, you can see we have many "effective duplicate" records. For example, nothing changed for Bob between 1/1/2014 and 1/31/2014 -- those really should be one record, not three. Here's the challenge: I'm looking for an efficient way to merge these "effective duplicates" together, through set-based sql updates/deletes/inserts (hoping to avoid any RBAR operations). Here's what the table ultimately should look like (cheating to get there):

create table mytbl2 (
effective_date smalldatetime,
expiration_date smalldatetime,
employee_id int,
employee_name varchar(30),
employee_dept int

[code]...

Note that Bob only has two records (he changed department), Frank only has one record (no changes), and Cheryl has three records (two department changes).

My inclination would be to drop the unwanted columns, then GROUP BY all the remaining columns from the source system, and taking the MIN effective_date and MAX expiration_date. However, this doesn't work for cases like Cheryl's -- she moved to another department, then back again, so that change history needs to be retained.

As I mentioned, we have hundreds of tables, and I'd like to strip out dozens (maybe hundreds) of unused columns, so ultimately there will be millions of these pseudo-duplicates that need to be merged together. These are huge tables, so I really need to find an efficient set-based approach to this.

View 2 Replies View Related

T-SQL (SS2K8) :: Merging From One DB To Another If Have Identity Column On Both Database

May 19, 2014

How to merge the data from one database to another if we have identity column on both the database. If we are merging two companies,we need employee table of 2 database and insert them into first database and corresponding fkey tables say some 7 tables.how to merge if the table is having identity column.

DatabaseA has 7 Tables
Namely T1,T2,....T7

DatabaseB has 7 Tables
Namely T1,T2,....T7

T1 is master
T2 is Child

DatabaseA
T1
|
----------------
| |
T2 T3
| |
----------------- ---------------
|| | |
T4T5 T6 T7

DatabaseB
T1
|
----------------
| |
T2 T3
| |
----------------- ---------------
|| | |
T4T5 T6 T7

All the tables have interrelationship as shown pkey and Fkey

All the T1...T7 have Pkey with identity column starting from 1 and corresponding Fkey column in their child tables

Database A Table information Rows
T1-10000
T2-5000
T3-5000
T4-5000
T5-5000
T6-5000
T7-5000

Database B Table information Rows
T1-20000
T2-10000
T3-10000
T4-10000
T5-10000
T6-10000
T7-10000

Now i want to merge all the data from Database B to DatabaseA

How can i merge since in DatabaseA id for T1 starts from 1,2,3,4...and so on...

DatabaseB id for T1 also starts from 1,2,3,4...and so on...

and the fkey tables also have same 1,2,3,4...and so on... with reference of parent table

View 3 Replies View Related

Identical Database W/ Identical Stored Procedures?

Oct 25, 2005

We have written an application which splits up our customers data intotheir individual databases. The structure of the databases is thesame. Is it better to create the same stored procedures in eachdatabase or have them in one central location and use the sp_executesqland execute the generated the SQL statement.Thank you.Mayur Patel

View 4 Replies View Related

Aggregating Financial Data To 1 Minute Intervals

Aug 19, 2006

I'm trying to create a query to return Open, Close, Max and Min Price for each 1 minute interval. Source data has two fields - Price, and Datestamp at 5 second intervals.

I can calculate the Max and Min (below) and set the datestamp to the middle of the interval, but get stuck on how to also return the Open and Close price for each interval.

SELECT MAX(price) AS MaxPrice, MIN(price) AS MinPrice,
DATEADD(ss, 30, DATEADD(n,DATEDIFF n, '1/1/2006', DateStamp),'1/1/2006')) AS DateStamp
FROM MasterData
GROUP BY DATEDIFF(n, '1/1/2006',DateStamp)

Any ideas?

thanks in advance.

View 1 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

SQL Server 2012 :: Group Data Into 15 Minute Intervals

Apr 8, 2015

I want to group my data into 15 minute interval . Below is my sample data and desired result set.

Create TABLE #HalfHourlyIntervals
(
OrderDate DATETIME,
IRevenue FLOAT,
TRevenue FLOAT
)

[Code] ....

View 9 Replies View Related

Data Transfer From Two Identical Tables.

Apr 2, 2008

Hi,
I have two tables named Tab1 and Tab2. Both are identical in structure. The only diff is Tab2 has two more additional fields (FromDate and ToDate).
The structure is like below :
Col1
Col2 (Date field)
Col3
Col4

Also Tab 2 have
Col5 (From Date)
Col6 (To Date)

Now I want to transfer some set of reocrds from Tab1 to Tab2. The additional Tab2 field (Col5 and Col6) values should be the minimum and maximum values of Tab1 date field for the current set.

How to accomplish this? Kindly help me in this regard.

Thanks
Somu

View 1 Replies View Related

Join Tables With Almost Identical Column Data

Oct 29, 2014

Selecting the data from these two tables? The columns 'host_ext_id' have the same data BUT in 'adrmst' all data is preceeded by A0000.

table is 'adrmst'

Host External IDAddress NameAddress Line 1Address Line 2City StatePostal Code
A000042401 T-3803VC 1530401 00 WENGER STTOPEKA KS66609
A000042402 CO INC 960 PP TOMLIN MILL RDSTATESVILLENC286258332
A000042403 CO INC 1420 PP BLVD GARYSBURGNC278319748
A000042405 CO INC 1419 PP BROWN RD KISSIMMEEFL347463415
A000042405 CO INC 962 PP COMMERCE DRVALDOSTAGA316011206

table is 'shipment'

Shipment IDHost External IDcar_move_idP_DEST_LOC_ID
42401 42401
42402 42402 SDQD_00862TAGSDQD
42403 42403 SDQD_00863TAGSDQD
42404 42404 SDQD_00863TAGSDQD
42405 42405 SDQD_00863TAGSDQD

View 4 Replies View Related

Peculiar Problem With Seemingly Identical Data

Jul 20, 2005

Hello,I have this peculiar problem concerning MS SQL Server.My company works with an mailing application (ASP) which uses SQLServer as it's repository. What I want to do is send data directlyfrom my own application to this SQL Server in order to feed themailing application.To test if this was possible I linked the tables from SQL Server in MSAccess and entered the data. This worked fine and the data was pickedup correctly by the mailing application.The problem occurs when I send the data from my application (Javaapplication with JDBC connection). The data is in this case no longerpicked up by the application. The strange thing is that the data whichis entered through Access and the data from the Application lookidentical in de database view. The problem also occurs when the datais send with the tool winSQL and when I view the data in here it stilllooks identical.Even more strange is when I select the record which is not working inAccess and copy it into a new record (only changing the key) itsuddenly works!Has anyone have an idea how this can be?Thanks in advance,Sander Janssen.

View 3 Replies View Related

EXtract Data From 10 Identical Oracle Database Into One

Sep 25, 2007



Please guide me urgently how to extract data in SSIS from 10 identical oracle database into 1 sql server database.
There is a table which list all the 10 databases.

View 2 Replies View Related

Power Pivot :: Merging Static Excel Data With Dynamic Data?

Aug 19, 2015

I have some data in Excel - sheet1 which would be static.

Now I need to import data from SQL Server (using a query) and Union above static data with this SQL data and later I will have to create PowerPivot table in Sheet2.

Which is suitable option for me to import data from SQL to excel as I see "From SQL Server" option under "Data" and "Power Query" tab as well.

How to merge above SQL data with existing static data?

(SQL Server 2012)

View 6 Replies View Related

SQL Server 2008 :: Compare Data Between Identical Table Structure?

Jun 18, 2015

I have two identical table structure with at least 60 or more columns!!

Table A
ID numeric(18, 0) Primary Key,
RefID numeric(18, 0),
CoNum Varchar(15),
PrevCode Varchar(15),
DispCode VArchar(15),
EffDate Date,
Sal numeric(18, 0),
SDeposit numeric(18, 0) Etc....

I need to compare Data between two table and provide result like this!

RefId ID, CoNum, PrevCode, DispCode, EffDate, Sal, SDeposit
1, ,No Match, ,20,5200,0

So condition like. If table A Column Data does not Equal Table B Column data then

If datatype is Date then display Difference of Days.

if Datatype is Numeric then display Difference between value.( it display 0 if doesn't have difference)

if Datatype is Varchar then display No Match word.

View 0 Replies View Related

Merging Data

Jun 3, 2008

I have 2 tables that have the exact same structure and have some common values.
T1 = a,b,c,d,e
T2 = e,f,g,h

I want to create a single distinct table which captures all unique in both tables. I have a common fields ID in both, I can match on. I don't want duplicates which is what's happening now..

CombinedT = a,b,c,d,e,f,g,h

Thanks.

View 3 Replies View Related

Merging Data

Jan 12, 2007

I have a function that returns a range of numbers and a query that returns a varchar field and an int field. I would like to replace the int field in the query with unique ranged numbers from the function(one per row).

Any ideas?

Thanks,
Mark

-- use ifms

select *
from dbo.fnRange(5101,5152)


select --distinct s.OrgKeyId, 10420 TableNumber, 5100 DetailCodeNumber, s.NewStratalabel CodeDescription, s.NewStratalabel CodeAbbreviation, 1 CodeActiveFlag, Getdate(), 0
distinct s.NewStratalabel, 5100
from _StrataLabel_xref s
Left Outer Join(select * from org_Detail_Code where tablenumber = 10420 and orgkeyid in (Select distinct OrgkeyId from _StrataLabel_xref)) o
on o.OrgKeyId = s.OrgKeyId and o.CodeDescription = s.NewStratalabel
where o.Detailcodenumber is null
order by s.NewStratalabel


5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152

H3Bt5100
H3Cr5100
H4Bt5100
HS1Ar5100
HS1Cr5100
HS2Air5100
HS2Ar5100
HS2Br5100
HS2Cr5100
HS3Ai5100
HS3Bi5100
HS3Bit5100
HS3Cr5100
HS4Am5100
HS4Bi5100
HS4Bm5100
HS4Bt5100
HS4Ct5100
HS4Dr5100
NFrd5100
S2Ap5100
S2Ar5100
S2Ax5100
S2Bp5100
S2Br5100
S2Bw5100
S2Bx5100
S3Ap5100
S3Aw5100
S3Ax5100
S3Bw5100
S3Bx5100
SH1Api5100
SH1Br5100
SH1Cr5100
SH2Air5100
SH2Ap5100
SH2Ar5100
SH2Ax5100
SH2Bir5100
SH2Bix5100
SH2Bp5100
SH2Br5100
SH2Bw5100
SH3Ai5100
SH3Ap5100
SH3Api5100
SH3Bw5100
SH3Cr5100
SH3Di5100
SH4Bm5100
SH4Bwi5100

View 3 Replies View Related

SQL Server 2012 :: Moving Identical Data From One Table To Another - Error On Converting To Float

Jun 11, 2014

So I have two tables with similar columns etc, unfortunately the Insert to the History table fails. Noto sure how to format.

Source Table.
CREATE TABLE [dbo].[SKUCURRENT](
[UID] [int] IDENTITY(1,1) NOT NULL,
[SKU] [nvarchar](100) NOT NULL,
[WHSELOC] [nvarchar](50) NOT NULL,
[WEIGHT] [nvarchar](50) NOT NULL,

[Code] ....

View 1 Replies View Related

SSIS : Merging Two Data Sources Data

Jul 9, 2007

Hi guys,

I manage to get the SSIS working. Now I would need to do these tasks.

I first want to get data from 2 different sql servers. What would be the best method to accomplish this? Both are in Sql Server 2005.

Secondly I want to make sure if any of the servers couldn't be found on the network or in any case the getting data task failed for any one of them the package won't continue and an email should be send to an email address.

Thirdly If everything is ok then I should combine both and generate one sequence no for them and save them on to another location and then generate a file with modified values.


Can anyone help me regarding these tasks?



Thank you



Gemma

View 17 Replies View Related

Merging Data From Two Databases

Sep 14, 2007

i have two databases one has
firstname, lastname
and the othere
firstname, lastname, emailaddress

how do i get to merge the data from emailaddress to the 1st datbase?

Melvin Felicien
IT Manager
DCG Properties Limited

View 6 Replies View Related

Merging Row Data Or Any Suggestions

Feb 5, 2008

Hi
I have been given a table that contains data in this format:

SALESPERSON SALESPERSON_ID CLIENT DATE_FROM DATE_TO AGE
TOM 12345 NULL NULL NULL NULL
NULL NULL MARYSMITH 1/1/2008 12/31/2008 46
NULL NULL JANEDOW 1/1/2008 12/31/2008 24
ED 56789 NULL NULL NULL NULL
NULL NULL TOMJONES 1/1/2008 12/31/2008 65
ANTHONY 243546 NULL NULL NULL NULL
NULL NULL BEVBLACK 1/1/2008 12/31/2008 15
NULL NULL JEANTHOMAS 1/1/2008 12/31/2008 29

Basically this is ONE table that contains header and detail data ordered sequentially. There are not unique identifiers for the rows. The rows are ordered sequentially so that each SALESPERSON is followed by one or more CLIENTs.

If I could merge the rows, the result would look like:

SALESPERSON SALESPERSON_ID CLIENT DATE_FROM DATE_TO AGE
TOM 12345 MARYSMITH 1/1/2008 12/31/2008 46
TOM 12345 JANEDOW 1/1/2008 12/31/2008 24
ED 56789 TOMJONES 1/1/2008 12/31/2008 65
ANTHONY 243546 BEVBLACK 1/1/2008 12/31/2008 15
ANTHONY 243546 JEANTHOMAS 1/1/2008 12/31/2008 29


I am not how to do this with this data.

I also thought maybe it would be better to add unique identifiers to each set of SALESPERSONs/CLIENTs, and work with the data that way, but I am not sure how to do that.

Any help or suggestions would be appreciated. I have no ability to change this data - I have to try to work with it if possible.



JLH

View 4 Replies View Related

Problem In Merging Data

Aug 13, 2006

Hello, i have a database which is subscrribed into two databases. It is subscribed to one database throught a PUSH SUBSCRIPTION and it is subscribed to another with PULL SUBSCRIPTION. The problem is that it is correctly syncronized with PUSH SUBSCRIPTION publication but it does not merge data correctly to PULL PUBLICATION.

When i try to run Merge Agent from subscriber it gives me following error:

Retrieving publication information
Retrieving subscription information
The specified subscription type is invalid.
Category:NULL
Source:  Merge Process
Number:  -2147201020
Message: The specified subscription type is invalid.


 

P.S : When i run Merge Agent from EM, it says, " No Data to be merged "

Regards,

View 1 Replies View Related

Merging Data From Excel To Server

Dec 24, 2014

Working on sql integration with hybris. i was new to this hybris environment previously my job was completly admin part. Now i got a project where i need to fetch data from hybris (Data Hub) and then i need to maintain the same records in sql server with same attributes and sometimes we need to add new attributes and tables even.

How we can import data from the excel sheet to sql server. For this i have gone through 2 approaches whether using merge statement through stored procedure or SSIS package (I don't know whether it works out for the same to merge data in sql server, if it works). Which of the procedure is more efficient. previously my tasks were completely admin tasks and i dnt have much knowledge about developing part.

View 6 Replies View Related

Merging A Data Cube With An Sql Database

Sep 3, 2007



I've seen posts about merging 2 databases but everyone is talking about 2 SQL based databases. I have a data cube based on MDX query giving me all the Sales data. I have a Excel sheet with the Budgets in it, thanks to the connector i can browse through my Excel file using SQL statements.

Now the problem that i have is i want to merge these 2 data's into one report i want to provide Sales figures from the cube with the budgets next to them which are stored in the Excel file.

So basicly is it possible to merge an MDX based database with an SQL database ? Cuz all the solutions i have found to far is by joining databases which is always done on SQL level.

Is this possible or just impossible ?

Thanks in advance
Joa

View 5 Replies View Related

Merging Data Values (HELP NEEDED!!)

May 7, 2007



Hi,



i'm new to this and i am trying to create a statement that would add the values together for Hong Kong and China and then delete the Hong Kong road. (this is a example what i am trying to acheive)

anyone know how to do this.








Name

Area

Population


China

54546554

545845110


Hong Kong

1222

1212


United Kingdom

1215455

1212154


France

2354545

5445445



Many thanks

View 3 Replies View Related

Data Access :: Merging Two Rows In Two Columns

Jul 8, 2015

I have a table data as shown below.

IDFNLN
1x
1y
2a
2b
3g
4t

I want output as shown below.
  
IDFNLN
1xy
2ab
3g
4t

I want the two duplicate rows to be merged into one. How to achieve it.

View 10 Replies View Related

Copy Data In Sql Server Table A To B On Same Server - Identical Schemas

Dec 13, 2006

Greetings,

I have two SQL Server tables on the same server and in the same database. I'll call them table A and table B. They have identical schemas. I need to insert all rows in table A into table B. (Don't laugh - this is just for testing and long run the tables will reside on different servers.)

Can someone please tell me the correct task to use for this and the connection type I need for both the source and destination?

Thanks,

Black Cat Bone

View 9 Replies View Related

Date Intervals

Jan 30, 2006

Is that like some interval function for dates, like i want to group my data in intervals of 15 minutes and 30 minutes. Is there such a function in T-SQL

View 4 Replies View Related

X Axis Intervals

May 4, 2008



Hi All,


I am working on a line chart. The variable on the X- axis is DateTime. The requirement is to have the values displayed with an interval of 4 hours (or mabe 5 or 6 hours - basically every regular intervals). I am using a list control to Subreports to show around 10 reports.

HOW can I do this? The Major and MInor intervals only help in separating which samples will be displayed. But we cannot configure for regular intervals.
Please help.

Thanks in advance,


Manoj Deshpande.

View 1 Replies View Related

Generate 5 Minute Intervals

Jan 28, 2008

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.

View 3 Replies View Related

How To Get Predicion For Monthly Intervals?

Jan 14, 2007

hi,

I am using timeseries algorithm.I am training my model like the following

Date StudId Perf

5/1/2005 001 99

5/10/005 001 97.6

6/1/2005 001 94

6/10/2005 001 99

6/30/005 001 96

10/1/2005 001 100

Like that.

I need prediction Output like following

Date StudId Perf

10/1/2005 001 99

11/10/005 001 97.6

12/1/2005 001 94

1/10/2006 001 99

... how to write prediction query for this.

Thanks

Karthik.

View 6 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







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