overlapping

TSQL get overlapping periods from datetime ranges

限于喜欢 提交于 2019-12-24 17:19:41
问题 I have a table with date range an i need the sum of overlapping periods (in hours) between its rows. This is a schema example: create table period ( id int, starttime datetime, endtime datetime, type varchar(64) ); insert into period values (1,'2013-04-07 8:00','2013-04-07 13:00','Work'); insert into period values (2,'2013-04-07 14:00','2013-04-07 17:00','Work'); insert into period values (3,'2013-04-08 8:00','2013-04-08 13:00','Work'); insert into period values (4,'2013-04-08 14:00','2013-04

How can I query for overlapping date ranges?

扶醉桌前 提交于 2019-12-24 09:48:42
问题 I'm using SQL Server 2008 R2 and trying to create a query that will show whether dates overlap. I'm trying to calculate the number of days someone is covered under a certain criteria. Here is an example of the table... CREATE TABLE mytable ( CARDNBR varchar(10) GPI char(14) , GPI_DESCRIPTION_10 varchar(50) , RX_DATE datetime , DAYS_SUPPLY int , END_DT datetime , METRIC_QUANTITY float ) INSERT INTO mytable VALUES ('1234567890','27200040000315','Glyburide','01/30/2013','30','03/01/2013','60')

Overlapping Booking SQL [duplicate]

末鹿安然 提交于 2019-12-24 08:07:56
问题 This question already has an answer here : Overlapping Booking Query (1 answer) Closed last year . I have a similiar problem with my sql statement like here Room Booking Query. the following query works if an apartment has only one booking. but if an apartment has more than one booking, this apartment is also in the result, although it is not available in the requested time range. SELECT DISTINCT `apartment`.* FROM `apartment` `apartment` LEFT JOIN `booking` `booking` ON `apartment`.`uid` =

Overlap of nested lists creates unwanted gap

穿精又带淫゛_ 提交于 2019-12-23 23:07:20
问题 I have a nest containing three lists which are being filled by a for-loop and the fill is controlled by if-conditions. After the first iteration it could look like the following example: a = [[1,2,0,0,0,0],[0,0,4,5,0,0],[0,0,0,0,6,7]] which, by condition, are not overlapping. After the second iteration new values are being appended to the corresponding nested lists. In order to make sure the lists are the same length I append zeros in each run. As soon as I set a condition so two lists

Content overlapping div

心不动则不痛 提交于 2019-12-23 17:40:26
问题 I'm having issues with overlapping contents. When I try this code for the HTML the text within content_left overlaps the entire area i want it to contain. When I change height to auto, it does not solve the problem.. Contents overlap to the right and the bottom is cut off. #wrapper { height: 1500px; margin: 20px auto auto auto; padding: 0; background: url(wrapper.png); } .content_left { float: left; width: 600px; padding: 20px 0 0 30px; margin-left: -300px; position: relative; height: auto; }

Flot bar chart: bars overlapping on time axis issue

痞子三分冷 提交于 2019-12-23 10:13:16
问题 I am trying to plot expense data against time axis, and I see the data bars are overlapping if they are showing data for the same date. I was expecting the graph to show the bars asjascent to each other but that is not the case. See a sample of code at this link... $.plot($("#placeholder"), newJson, { bars: { show: 1, barWidth: 24 * 60 * 60 * 1000 * 10 }, xaxis: { mode:"time" } }); 回答1: Unfortunately, that isn't possible in flot without using some sort of plugin. I suggest you either use the

How to divide image matlab into overlapping block

烈酒焚心 提交于 2019-12-23 05:26:15
问题 I need to divide an image 512*512 into 41*41 overlapping using matlab.In other words, I want to take first a 41*41 block centred in q then I shift by a pixel and I take a 41*41 centered in q+1 and so on.. I can't use Blockproc because it gives a not overlapping block. thanks to help me 回答1: You CAN use BLOCKPROC. It is a bit non-obvious. Set a block size of [1 1], and then use the 'Border' parameter to specify how big a block you want around each pixel: >> a a = 8 1 6 3 5 7 4 9 2 >> blockproc

Avoiding gaps in datetime intervals with CTE and start and end datetimes

五迷三道 提交于 2019-12-23 04:28:11
问题 For some reason I am seeing gaps in my time intervals using this query. I have gotten it to work when just using basic data. However, when joining my tables and specifying a WHERE clause, I see gaps in my time interval. I also need to incorporate the S.SessionEndTime in my intervals to find a count of records where there is overlap with a given 1 minute interval between the ResponseTime and SessionEndTime. Here is the query I am using. By using a derived table, I get a MAX per hour based on

How to capture onTouch events on two overlapping views?

£可爱£侵袭症+ 提交于 2019-12-22 05:06:57
问题 Layout !* Container is a relative layout contains two custom views: OuterView1 and InnerView2 * Outer View1 is a custom view, matching the parent’s size (full screen) * Inner View2 is also a custom view, laid on top of OuterView1 overlapping it. Container is a relative layout contains two custom views: OuterView1 and InnerView2 Outer View1 is a custom view, matching the parent’s size (full screen) Inner View2 is also a custom view, laid on top of OuterView1 overlapping it. On both OuterView1

Fragments BackStack. Fragments overlap even after pop.

杀马特。学长 韩版系。学妹 提交于 2019-12-21 20:45:55
问题 The problem is to manage properly back stack so the previous fragment is poped out (or deleted). The problem is in their overlapping.. The structure of program as follows: sliding menu with 3 fragments for each section: CatalogFragment , NewsFragment , BlogFragment ; each fragment is a listView with items (parsed from JSON); on CatalogFragment 's item click I need to replace this CatalogFragment with LessonsFragment , which is list also. p.s. Items is in russian but I think you can understand