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

Python range() builtin function, erm... malfunctioning with Django

What, if anything, is wrong with this line of python code: daterange = [begin + timedelta(n) for n in range((end - begin).days)] Where begin and end are datetime.date objects with valid values. I'm using this in a Django view to process some data,…
chandsie
  • 2,865
  • 3
  • 27
  • 37
3
votes
1 answer

Aggregate column values of rows that have overlapping range of dates

I have a data frame that looks like this: person date1 date2 total amount overlap A 2019-03-01 2019-03-16 50 A 2019-03-10 2019-03-31 100 A 2019-03-20 2019-03-31 70 …
3
votes
1 answer

How to insert/copy one partition's data to multiple partitions in hive?

I'm having data of day='2019-01-01' in my hive table, I want to copy same data to whole Jan-2019 month. (i.e. in '2019-01-02', '2019-01-03'...'2019-01-31') I'm trying following but data is only inserted in '2019-01-02' and not in…
axnet
  • 5,146
  • 3
  • 25
  • 45
3
votes
1 answer

Setting date range limit on kendo-daterange

Requirement for my reporting page is: default date start = 1st of month (done) default date end = today's date (done) Since we do not want application to crash with with data, Date range should not exceed 30 days. I am not being able to achieve this…
SilverFish
  • 1,014
  • 6
  • 28
  • 65
3
votes
2 answers

MySQL Select date ranges between data series separated with NULL

This is a part of solving a more complex problem. There is a table with data: +------------+------+----------+-----------+ | date | data | data_max | data_diff | +------------+------+----------+-----------+ | 2017-01-02 | 2 | 2 | …
Jimmix
  • 5,644
  • 6
  • 44
  • 71
3
votes
1 answer

sky field data to get Apogee and Perigee for a given date range

I tried to loop the sky field data to get Apogee and Perigee for a given date #range but could not succeed. Grateful for any help. Thanks in advance import numpy as np import matplotlib.pyplot as plt from skyfield.api import Loader, Topos load =…
Chaks
  • 31
  • 3
3
votes
1 answer

How to construct date range query when not all dates exist in hierarchy?

New to MDX and inherited an application using the following to retrieve the last 7 work days. Note, the actual dates are generated dynamically. WHERE ( [DimCalendar].[WorkDayHierarchy].[WorkDate].&[2016-03-25T00:00:00] :…
SOS
  • 6,430
  • 2
  • 11
  • 29
3
votes
2 answers

Pandas : How to sum column values over a date range

I am trying to sum the values of colA, over a date range based on "date" column, and store this rolling value in the new column "sum_col" But I am getting the sum of all rows (=100), not just those in the date range. I can't use rolling or groupby…
user52909
  • 31
  • 1
  • 2
3
votes
2 answers

jquery UI datepicker - disabling date ranges

I'm struggling to get something working - I'm getting a 'Uncaught TypeError: Cannot read property '0' of undefined' error with the below and I can't figure out why! I'm trying to use the jQuery UI datepicker on a site for a holiday cottage to…
BellamyStudio
  • 771
  • 2
  • 9
  • 22
3
votes
2 answers

Split date range overlaps into chunks (javascript)

I came up with a concept, but am having trouble converting it into code. Here's a picture to better help explain my idea: Can't tell by the picture, but there can be gaps between dates as well. Not to make it an XY-problem, here's why I need to do…
3
votes
1 answer

How Can I Group By a Range of Dates in SSRS Report Builder?

I have a list of individual subscribers to a health plan. Each subscriber has a range of dates to indicate eligibility with the plan. To help illustrate, here is a mock list of records for eligible subscribers during 2018-Q1, written in T-SQL for MS…
Pepe
  • 31
  • 2
3
votes
2 answers

How can I turn data imported into python from a csv file to time-series?

I want to turn data imported into python through a .csv file to time-series. GDP = pd.read_csv('GDP.csv') [87]: GDP Out[87]: GDP growth (%) 0 0.5 1 -5.2 2 -7.9 3 -9.1 4 -10.3 5 …
Nick555
  • 33
  • 4
3
votes
1 answer

Get is_purchasable hook working for Woocommerce product variations too

I have made 2 custom product fields - availability - since when/until when. So if the current date is between these set availability dates then product is purchasable, else - it's not. Everything works perfectly however only until I post a product…
fuji
  • 317
  • 2
  • 19
3
votes
2 answers

query date ranges postgresql

I have the following postgresql table; ID Date 1 [2017-01-01,2051-01-01) 2 [2017-01-01,2051-01-01) 3 [2017-01-01,2051-01-01) 4 [2017-01-01,2051-01-01) 5 [2000-01-01,2017-01-01) 6 [2000-01-01,2017-01-01) 7 [2017-01-01,2051-01-01) 8 …
shahzad ise
  • 45
  • 2
  • 6
3
votes
2 answers

Timestamp comparing in timestamp range?

I currently have 2 timestamp fields in my RubyOnRails database defined as: starttime:timestamp endtime:timestamp I want to write a simple function in my controller which will take the current time and return TRUE if it lies in the range of the…
dpigera
  • 3,339
  • 5
  • 39
  • 60