datediff Questions

5

Solved

I'm trying to find out the time between certain fields in my tables. However cause I'm using Postgresql :(( I can't use the DATEDIFF function. I can't find any clear guides/ tutorials on the net wh...
Diarmuid asked 8/4, 2012 at 19:45

14

Solved

I have a select query that has DURATION column to calculate number of Minutes . I want to convert those minutes to hh:mm format. Duration has values like 60, 120,150 For example: 60 becomes 01:0...

36

How to get the difference between two dates in years, months, and days in JavaScript, like: 10th of April 2010 was 3 years, x month and y days ago? There are lots of solutions, but they only offer ...
Corvin asked 18/7, 2013 at 20:4

3

Solved

I'm working with ES and I need a query that returns the difference between two datetime (mysql timediff), but have not found any function of ES to do that. Someone who can help me? MySQL query: SEL...
Youmans asked 18/9, 2015 at 18:21

27

Solved

What would be the best way to calculate someone's age in years, months, and days in T-SQL (SQL Server 2000)? The datediff function doesn't handle year boundaries well, plus getting the months and ...
Jugulate asked 11/9, 2008 at 20:50

6

Solved

I have a fairly simple query; it looks as such: SELECT order_date, pickup_date, DATE_DIFF(pickup_date,order_date, day) order_to_pickup FROM `orders.table` The only is issue is, I need to be calc...
Burgle asked 2/5, 2019 at 16:4

4

Solved

Is there any ways to calculate working days between two dates in snowflake without creating calendar table, only using "datediff" function

3

Solved

I am new to Spark SQL. We are migrating data from SQL server to Databricks. I am using SPARK SQL . Can you please suggest how to achieve below functionality in SPARK sql for the below datefunctions...
Giza asked 27/9, 2018 at 0:1

2

Solved

They have the same format: $date_expire = '2014-08-06 00:00:00'; $date1 = date("Y-m-d G:i:s"); $date2 = date_create($date_expire); $diff = date_diff($date1, $date2); //this line makes er...
Confab asked 7/7, 2014 at 10:31

3

Solved

Is there an equivalent to SQL's datediff function in Python's pandas? The answer to this question: Add column with number of days between dates in DataFrame pandas explains how to calculate the dif...
Confute asked 6/5, 2016 at 17:37

6

Solved

Here I need to calculate the difference of the two dates in the PostgreSQL. In SQL Server: Like we do in SQL Server its much easier. DATEDIFF(Day, MIN(joindate), MAX(joindate)) AS DateDifference...
Diakinesis asked 24/7, 2014 at 9:17

33

Solved

I have two dates of the form: Start Date: 2007-03-24 End Date: 2009-06-26 Now I need to find the difference between these two in the following form: 2 years, 3 months and 2 days How can I do...
Glaucous asked 24/3, 2009 at 10:33

29

Solved

How would I work out the difference for two Date() objects in JavaScript, while only return the number of months in the difference? Any help would be great :)
Mascia asked 29/3, 2010 at 7:34

7

Solved

I want to calculate the number of days passed between past date and a current date. My past date is in the format dd/mm/yyyy format. I have used below mentioned formulas but giving the proper outpu...
Conrad asked 6/1, 2013 at 15:17

2

Solved

I have recently been informed that the use of the BETWEEN method in SQL is somewhat unreliable, and I should therefore be using DATEDIFF(). However, another programmer has informed me this is not t...
Plauen asked 4/1, 2013 at 8:48

2

Solved

Looking to do the SQL equivalent of datediff in R? Basically, I want this calculation in R Delivery Date Expected Date Difference 2022-01-05 2022-01-07 -2
Ricotta asked 5/1, 2022 at 16:52

21

Solved

I'm looking to calculate the number of months between 2 date time fields. Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL...
Screamer asked 14/11, 2008 at 1:38

5

Solved

I have two date variables: $dnow = "2016-12-1"; $dafter = "2016-12-11"; I want to calculate the difference of this two dates which are in string format so how do I calculate? I used date_diff(...
Heathcote asked 1/12, 2016 at 8:7

33

Solved

In Ruby on Rails, there is a feature that allows you to take any Date and print out how "long ago" it was. For example: 8 minutes ago 8 hours ago 8 days ago 8 months ago 8 years ago Is there an...
Bargain asked 4/10, 2010 at 21:29

7

Solved

There has to be an easier way to do this. I have objects that want to be refreshed every so often, so I want to record when they were created, check against the current timestamp, and refresh as ne...
Gilboa asked 6/12, 2010 at 1:28

6

Solved

I receive reports in which the data is ETL to the DB automatically. I extract and transform some of that data to load it somewhere else. One thing I need to do is a DATEDIFF but the year needs to b...
Girlie asked 17/4, 2014 at 23:59

3

I would like to query a database using sql to show the difference in time between id 1,2,3 and so on. basically it will compare the row below it for all records. any help would be appreciated. ID...
Earthshine asked 20/4, 2011 at 10:4

4

Solved

I've got an entity with a starting date and an ending date. Is it possible to get the difference in time between them by using twig?
Runyan asked 27/3, 2013 at 11:25

4

Solved

I'm attempting to fulfill a rather difficult reporting request from a client, and I need to find away to get the difference between two DateTime columns in minutes. I've attempted to use trunc and ...
Imide asked 15/10, 2008 at 20:11

6

Solved

I can get a datetime with microseconds in PHP with a workaround as: list($usec, $sec) = explode(" ", microtime()); echo date("Y-m-d\TH:i:s", $sec) . "." . floatval($usec)*pow(10,6); I need the d...
Saunders asked 15/8, 2013 at 15:43

© 2022 - 2025 — McMap. All rights reserved.