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
38
votes
3 answers

Grep inside all files created within date range

I am on the Ubuntu OS. I want to grep a word (say XYZ) inside all log files which are created within date range 28-may-2012 to 30-may-2012. How do I do that?
Vijayendra Bapte
  • 1,378
  • 3
  • 14
  • 23
34
votes
3 answers

Subsetting data.table set by date range in R

I have a large dataset in data.table that I'd like to subset by a date range. My data set looks like this: testset <- data.table(date=as.Date(c("2013-07-02","2013-08-03","2013-09-04", "2013-10-05","2013-11-06")),…
black_sheep07
  • 2,308
  • 3
  • 26
  • 40
33
votes
2 answers

How Do I Loop Through a Date Range in Reverse?

I have a date range that I would like to be able to loop through in reverse. Give the following, how would I accomplish this, the standard Range operator doesn't seem t be working properly. >> sd = Date.parse('2010-03-01') => Mon, 01 Mar 2010 >> ed…
Russ Bradberry
  • 10,705
  • 17
  • 69
  • 85
33
votes
6 answers

SQL join against date ranges?

Consider two tables: Transactions, with amounts in a foreign currency: Date Amount ========= ======= 1/2/2009 1500 2/4/2009 2300 3/15/2009 300 4/17/2009 2200 etc. ExchangeRates, with the value of the primary currency (let's…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
31
votes
4 answers

How to create a pandas DatetimeIndex with year as frequency?

Using the pandas.date_range(startdate, periods=n, freq=f) function you can create a range of pandas Timestamp objects where the freq optional paramter denotes the frequency (second, minute, hour, day...) in the range. The documentation does not…
imrek
  • 2,930
  • 3
  • 20
  • 36
26
votes
4 answers

ElasticSearch date range

I have the following query: { "query": { "query_string": { "query": "searchTerm", "default_operator": "AND" } }, "facets": { "counts": { "date_histogram": { "field": "firstdate", …
Crista23
  • 3,203
  • 9
  • 47
  • 60
22
votes
2 answers

Generating a report by date range in rails

How would you go about producing reports by user selected date ranges in a rails app? What are the best date range pickers? edit in response to patrick : I am looking for a bit of both widget and active record advice but what I am really curious…
srboisvert
  • 12,679
  • 15
  • 63
  • 87
21
votes
2 answers

Aggregate $group for multiple date ranges

In my aggregate, each document in the stream will have a date on it. I need to sum some values over date ranges.. My documents look like: { value: 3, date: [SoME TIME STAMP] }, { value: 4, date: [SoME TIME STAMP] }, { value: 1, date: [SoME TIME…
Zhen Liu
  • 7,550
  • 14
  • 53
  • 96
19
votes
2 answers

Find overlapping date ranges in PostgreSQL

Is this correct? SELECT * FROM contract JOIN team USING (name_team) JOIN player USING(name_player) WHERE name_team = ? AND DATE_PART('YEAR',date_join)>= ? AND DATE_PART('YEAR',date_leave)<= ? My table contract has the player…
aocferreira
  • 673
  • 2
  • 8
  • 15
19
votes
6 answers

SQL Server : fetching records between two dates?

In SQL I write a SELECT statement to fetch data between two dates, using between and Ex: select * from xxx where dates between '2012-10-26' and '2012-10-27' But the rows returned are for 26th only, not 26th and 27th. Can you help me? Thank you.
Ssasidhar
  • 475
  • 4
  • 12
  • 25
18
votes
2 answers

R Shiny DateRange Input month year only

Is there a way to Hack or Create a dateRangeInput() selector in Shiny so that it selects only month-year (no day) or that it automatically selects the first day of the selected month without displaying a day choice ? Or should I create another…
TiFr3D
  • 459
  • 1
  • 4
  • 11
18
votes
4 answers

How to handle dates in neo4j

I'm an historian of medieval history and I'm trying to code networks between kings, dukes, popes etc. over a period of time of about 50 years (from 1220 to 1270) in medieval Germany. As I'm not a specialist for graph-databases I'm looking for a…
Andreas Kuczera
  • 353
  • 1
  • 2
  • 14
18
votes
11 answers

MySQL query to select events between start/end date

I have a MySQL table named 'events' that contains event data. The important columns are 'start' and 'end' which contain string (YYYY-MM-DD) to represent when the events starts and ends. I want to get the records for all the active events in a time…
Guicara
  • 1,668
  • 2
  • 20
  • 34
18
votes
7 answers

Date range picker on jquery ui datepicker

I created a date range picker using jquery ui where you can use the same inline calendar to make both of your date selections. See my fiddle here: http://jsfiddle.net/kVsbq/4/ JS $(".datepicker").datepicker({ minDate: 0, numberOfMonths: [12,…
Mcestone
  • 794
  • 3
  • 10
  • 26
17
votes
7 answers

Getting Dates between a range of dates

I need to get all the dates present in the date range using SQL Server 2005
Harish KV