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
4
votes
2 answers

Create list with first and last day of month for given period

I have to generate a list with two columns of day intervals for every month in a specific period. First column must be the first day of month and the second column the last day of month. Example: Start date: 2014-01-01 End date: 2014-06-30 The…
user3276142
  • 91
  • 2
  • 8
4
votes
5 answers

find number of days exists within a date range

+-------+-----------+------+----------------------+----------------------+ |RATE_ID|DESCRIPTION|CHARGE|FROM_DATE |TO_DATE | +-------+-----------+------+----------------------+----------------------+ |1 |small |100…
ajmalmhd04
  • 2,582
  • 6
  • 23
  • 41
4
votes
3 answers

Count if date range fits within other date range

I have a set of data with names of people who are on vacation for certain dates (Name, Start, End). Example: Name Start End Joe 10-Jan-14 21-Jan-14 Billy 12-Feb-14 10-Mar-14 David 11-Jan-14 20-Jan-14 Patty 10-Jan-14 …
Jason97132
  • 43
  • 1
  • 4
4
votes
1 answer

Generate full category structure by date range history

I'm trying to query MySQL. I have 2 tables and the data looked like this: category_history_structure +----------------+-----------------+----------+----+-----------+------------+------------+ | category | parent_category | type | id |…
user2901403
  • 41
  • 1
  • 3
4
votes
2 answers

Input box date range in vba?

I have an excel file and in the first column (A) i have some dates like this: 17/10/2013 18/10/2013 19/10/2013 20/10/2013 21/10/2013 22/10/2013 The other columns contains some datas. I need create an input box that takes everything inside a date…
David_D
  • 1,404
  • 4
  • 31
  • 65
4
votes
1 answer

Merge overlapping time intervals, how?

Anyone could help me in a query that **merge a interval of datas? ex: Common select: SELECT id, date_start, date_end FROM evento ORDER BY date_start I GOT THIS: FROM THIS: but a want a query that return this: 01 - 2013-10-11 08:00:00 …
4
votes
3 answers

Reduce array of month names by creating hyphenated expressions from consecutive months

I have an array like: Array ( [0] => Jan [1] => Feb [2] => Mar [3] => Apr [4] => May [5] => Jun [6] => Sep [7] => Oct [8] => Dec ) I need to convert it to Array ( [0] => "Jan - Jun" [1] => "Sep - Oct" …
Bluemagica
  • 5,000
  • 12
  • 47
  • 73
4
votes
2 answers

DatePicker with glDatePicker. date range with two inputs

I'm using glDatePicker to generate a date range selection system. You have a From date input text and a To input text. Is there any way to pass the selected date of one instance of glDatePicker (From input) to another (To input) as…
SauronZ
  • 355
  • 3
  • 14
4
votes
1 answer

How to print a date range as a string?

I want to print a date range as string using R. Following is what I did > startDate <- as.Date("2005-02-02") > endDate <- as.Date("2005-02-07") > dates <- startDate:endDate > dates [1] 12816 12817 12818 12819 12820 12821 Here instead of showing the…
Vineeth Mohan
  • 18,633
  • 8
  • 63
  • 77
4
votes
2 answers

Ranges of dates overlapping

I have two variables containing dates. DateStart and DateEnd (in SQL). I also have two DatePicker controls (in a WinForm). I import the two dates from the database and need to do something tricky. So the two variables create a range of dates and the…
phadaphunk
  • 12,785
  • 15
  • 73
  • 107
4
votes
3 answers

How would I test if date is in date range (both strings)?

I have two strings, for example 05.04.2002 and 23.01-2002 - 23.06.2002. How would I find out if the date in my first string is between the dates in the second string? What I have been thinking dateString := '05.04.2002'; dateRangeString :=…
Joel Peltonen
  • 13,025
  • 6
  • 64
  • 100
3
votes
3 answers

Get all dates in date range in SQL Server

I got this example from one StackOverflow question that was asked but I couldn't get it work according to my need. WITH DateTable AS ( SELECT CAST('20110101' as Date) AS [DATE] UNION ALL SELECT DATEADD(dd, 1, [DATE]) FROM DateTable …
Soham Dasgupta
  • 5,061
  • 24
  • 79
  • 125
3
votes
3 answers

Creating a date range in python-polars with the last days of the months?

How do I create a date range in Polars (Python API) with only the last days of the months? This is the code I have: pl.date_range(datetime(2022,5,5), datetime(2022,8,10), "1mo", name="dtrange") The result is: '2022-05-05', '2022-06-05',…
Luca
  • 1,216
  • 6
  • 10
3
votes
2 answers

Creating sum of date ranges in Pandas

I have the following DataFrame, with over 3 million rows: VALID_FROM VALID_TO VALUE 0 2022-01-01 2022-01-02 5 1 2022-01-01 2022-01-03 2 2 2022-01-02 2022-01-04 7 3 2022-01-03 2022-01-06 3 I want to create one large date_range…
ChriKo_Amp
  • 33
  • 3
3
votes
1 answer

SQL Server query performance on longer date range

I am trying to query a table which has a column that stores the transaction data that is in XML. My filer option is actually 1 of the node in my XML data. So below is my query SELECT eRefNo, eCreationDate, eData FROM TableA WHERE…