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

Choose active employes per month with dates formatted dd/mm/yyyy

I'm having a hard time explaining this through writing, so please be patient. I'm making this project in which I have to choose a month and a year to know all the active employees during that month of the year.. but in my database I'm storing the…
Jesus Rodriguez
  • 2,571
  • 2
  • 22
  • 38
0
votes
4 answers

Select rows with time range containing the current time

I have a Postgres table with the following schema: id | name | sdate (timestamp) | edate (timestamp) ---+--------+---------------------+--------------------- 1 | test6 | 2013-05-13 01:16:16 | 2013-07-03 10:16:11 2 | test44 | 2012-05-10…
Kajal
  • 223
  • 4
  • 15
0
votes
1 answer

Maintaining date range calculations across rows without looping

I have a set of date values in Oracle that I am doing an ORDER BY START_TIME, STOP_TIME as in the data sample below. The column labeled NEXT_START_TIME, as you can see, is retrieved through the LEAD() function. START_TIME STOP_TIME …
McArthey
  • 1,614
  • 30
  • 62
0
votes
1 answer

Django 1.5+ Admin Date Range Filter

Does anyone have any recommendations for Django 1.5+ compatible Date Range Filter for the Admin page, I have tried a bunch for 1.4 and it doesn't seem to work. And I know the 1.3 does not work at all. I just need something better than Any date,…
Infinixd
  • 141
  • 15
0
votes
1 answer

SQL Syntax for date range in a multiple search query

I have this code written so far and it works for what I am doing but if I search for June 13 it will only look up until June 12, can someone help me figure whats wrong in my code? or where I can add a day interval? I tried and its just not working…
Alexandra
  • 65
  • 1
  • 2
  • 13
0
votes
2 answers

Range operators in Ruby similar to PostgreSQL

Is there a Ruby gem that enables Range calculations similar to what PostgreSQL does? Especially the time-related range functions?
Alex V
  • 353
  • 4
  • 10
0
votes
2 answers

Getting date range grouped by month

I have an form where users can select a date range. For example, a date range could be: $start = "5/1/2013"; $end = "6/5/2013"; I can easily grab the day difference between the two by doing something like: $date1 = new DateTime($start); $date2 =…
etm124
  • 2,100
  • 4
  • 41
  • 77
0
votes
2 answers

Check if date is in range of multiple date ranges

I have a list of certificates that have an expiry date. I am trying to show different colours depending on how far away they are from expiry. I need to show red if it expires in less than 30 days (or has already expired), amber if the date is…
Pooshonk
  • 1,284
  • 2
  • 22
  • 49
0
votes
5 answers

Count clicks in date range with SQL (PHP)

I want to count all clicks based on daily level from a date range. Let's say I want to count all clicks between "2013-05-01" - "2013-05-30" and want the following result to be something like this: date clicks 2013-05-01 50 2013-05-02…
Simon Thomsen
  • 1,351
  • 7
  • 27
  • 37
0
votes
2 answers

How to apply time slices to an existing SQL query

I have a table with approx 8 million rows that I need time slice data from. I'm using PostgreSQL 9.1. I need to query this table for a sum of the max(start_time) associated 'data' values for each 'object_id' (given a list), on a per day basis. (In…
0
votes
0 answers

Mysql best performance with dates

I have a big table with many many tuples, however I perform some queries just in a small range of this (extracted by date range), I would like to know how to set up the table struture to optimize the db work on date range. May I add startdate and…
Tobia
  • 9,165
  • 28
  • 114
  • 219
0
votes
1 answer

Designing non-overlapping date-time events

I have the following problem: Events have a "begin" and "end" time and an amount. I use MySQL DATETIME for both. Now if I have a constraint that says "no overlapping events" I need to make some checks etc. but how to design that? The user only needs…
FelixHJ
  • 1,071
  • 3
  • 12
  • 26
0
votes
2 answers

Days range as months in PHP

I am trying to output a number of months using days(value fro $daydiff). Whole code goes like: $ArrivalDate = $variants_data['ArrivalDate']; $daydiff=floor((abs(strtotime(date("Y-m-d")) - strtotime($ArrivalDate))/(60*60*24))); if…
Mlungisi
  • 51
  • 2
  • 10
0
votes
1 answer

SQL Server Membership Date Range

I am a newbie to SQL Server with a rather complex SQL task and none of the solutions I have found so far is fit for my problem below. I have a database table that currently holds membership joining information (extract below) with one line for each…
Babs
  • 195
  • 2
  • 3
  • 8
0
votes
1 answer

Counts on Date Range and Individual Days

I'm having to re-write a project that was done using a combination of SQL queries and Query-of-Queries in ColdFusion. There were dozens of queries referencing the original SQL Query results set, but it wasn't abstracted to work for different…
pixelwiz
  • 623
  • 1
  • 11
  • 20
1 2 3
99
100