Questions tagged [date-range]

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date range is commonly used:

  • as search criterion for any date related data,
  • when operating on data referring to periods of time.
1608 questions
3
votes
4 answers

slicing a portion of data within a certain x range using python(or pandas dataframe)?

I am running into issues with how I am using append operator in python 3.x. In my python code, I am trying to remove data points that has y value of 0. My data looks like this: x y 400.01 0.000e0 420.02 0.000e0 450.03 10.000e0 48.04 …
user7852656
  • 675
  • 4
  • 15
  • 26
3
votes
1 answer

Failure of Ruby case equality operator ===

I have: require 'date' pap1 = Date.parse('1968-06-12') pap2 = Date.parse('1968-12-31') dat = Date.parse('1968-06-12') dat2 = dat + 5 # => # In the example below, I want to test if a date falls in a…
3
votes
0 answers

SQL - Joining fact and dimension data within Date ranges

I have 2 tables in my sql server database that i would like to join based on their dates range. This data is confidential, i will try to keep this as clear as possible although i got to uncover the data, so i hope you are ok with that. One of the…
zStrike
  • 57
  • 6
3
votes
1 answer

Calculate free time periods (datetime) out of calendar appointments in python

I fetch appointments via Exchange EWS API and create json arrays containing start/end busy (datetime) periods. I want to reverse this data to fetch a list of free time periods per day. Office hours start is 8:00 a.m. Office hours end is 6:00…
NoKnow
  • 31
  • 4
3
votes
1 answer

How to check if a date is between two dates mysql?

I'm querying dates from a mysql database. When I try to select only the dates between a certain from and to date, I'm not getting the expected results back. My query: select * from tbl_billing where date BETWEEN '09-02-2017' and '10-02-2017' My…
phpguru
  • 29
  • 1
  • 3
3
votes
2 answers

Using IEqualityComparer GetHashCode with a tolerance

I am trying to implement an IEqualityComparer that has a tolerance on a date comparison. I have also looked into this question. The problem is that I can't use a workaround because I am using the IEqualityComparer in a LINQ .GroupJoin(). I have…
Matt Rowland
  • 4,575
  • 4
  • 25
  • 34
3
votes
4 answers

Find all date ranges for overlapping start and end dates in R

I have a data frame that looks like this: w<-read.table(header=TRUE,text=" start.date end.date 2006-06-26 2006-07-24 2006-07-19 2006-08-16 2007-06-09 2007-07-07 2007-06-24 2007-07-22 2007-07-03 2007-07-31 2007-08-04 2007-09-01 2007-08-07…
lg929
  • 234
  • 5
  • 13
3
votes
1 answer

Coalesce overlapping time ranges in PostgreSQL

I have a PostgreSQL (9.4) table that contains time stamp ranges and user IDs, and I need to collapse any overlapping ranges (with the same user ID) into a single record. I've tried a complicated set of CTEs to accomplish this, but there are some…
3
votes
1 answer

Get range from sparse datetimeindex

I have this kind of pandas DataFrame for each user in a large database. each row is a period of length [start_date, end_date], but sometimes 2 consecutive rows are in fact the same period : end_date is equal to the following start_date (red…
gowithefloww
  • 2,211
  • 2
  • 20
  • 31
3
votes
2 answers

how to group by a date range in MySQL and not skip dates with zero items

well, this might be easy but I can't seem to find any solution I have this working query SELECT count(*), TIMESTAMPDIFF(DAY, buydate, NOW()) daydif FROM order_item WHERE buydate > NOW() - INTERVAL 4 DAY GROUP BY daydif ORDER BY daydif…
azerafati
  • 18,215
  • 7
  • 67
  • 72
3
votes
1 answer

ElasticSearch: How to query a date field using a month & date range filter

Currently, I already know how to filter a date range from a (timestamp) date field. That's an easy one: "range": { "date": { "gte": "2015-11-01", "lte": "2015-11-30" } } But how to filter dates when you are interested in…
krishna kumar
  • 1,190
  • 12
  • 14
3
votes
0 answers

Create one single datepicker with predefined dates

I'm using daterangepicker 2.1.13. I want to create single datepicker with predefined dates as it is possible with ranges. So, if user clicks on it, it will show predefined values (like today on 8 clock and tomorrow on that clock) and a possibility…
Asqan
  • 4,319
  • 11
  • 61
  • 100
3
votes
1 answer

How to select between date range on a materialize date picker

I have a materialize date picker which allows me to select between 10 days in current date. But i want to select between 16/05/2016, 19/05/2016 dates and other dates will be disabled on the date picker (user cannot select other dates). My…
3
votes
3 answers

PHP combine two seperate conflicting date ranges into unique pairs

Set one: 2014-04-05 To 2014-06-27 2014-06-28 To 2014-10-19 Set two: 2014-04-05 To 2014-05-02 2014-05-03 To 2014-05-31 2014-06-01 To 2014-10-19 What I need this to output is: 2014-04-05 To 2014-05-02 2014-05-03 To 2014-05-31 2014-06-01 To…
vizon
  • 343
  • 4
  • 19
3
votes
2 answers

SQL - Count number of itemactive within a date rate

I have a dataset of Resources, Projects, StartDate and EndDate. Each Resource can be utilised by multiple projects. I want to get a count of the number of projects that are using a resource in each quarter. So if project starts in Q1 of a…
jmich738
  • 1,565
  • 3
  • 24
  • 41