Advertisement

02.18.2008 at 02:54AM PST, ID: 23170992
[x]
Attachment Details

Count days between dates

Asked by pruymboom in Access Reports, SQL Query Syntax, SQL Server 2005

Tags: SQL

Hello i have a table with 2 dates (format d-m-yyyy h:mm:s, example: 3-12-2007 9:05:03)
Is it possible to get the days between those dates?

I have the following table:

date1                            date2
------------------------     ---------------------
2-12-2007 23:00:00     3-12-2007 9:06:38
1-12-2007 10:24:23     3-12-2007 9:06:38
4-12-2007 23:00:00     10-12-2007 9:06:38
2-12-2007 23:00:00     15-12-2007 10:24:23
2-12-2007 10:24:23     15-12-2007 9:06:38

I want the result like below

date1                            date2                            days
------------------------     ---------------------         -----
2-12-2007 23:00:00     3-12-2007 9:06:38          1
1-12-2007 10:24:23     3-12-2007 9:06:38          2
4-12-2007 23:00:00     10-12-2007 9:06:38        6
2-12-2007 23:00:00     15-12-2007 10:24:23    13
2-12-2007 10:24:23     14-12-2007 9:06:38      12Start Free Trial
[+][-]02.18.2008 at 02:57AM PST, ID: 20918899

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Reports, SQL Query Syntax, SQL Server 2005
Tags: SQL
Sign Up Now!
Solution Provided By: ee_rlee
Participating Experts: 4
Solution Grade: A
 
 
[+][-]02.18.2008 at 02:58AM PST, ID: 20918905

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.18.2008 at 03:02AM PST, ID: 20918922

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.18.2008 at 06:43PM PST, ID: 20925301

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 07:05PM PDT, ID: 21603089

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.24.2008 at 08:01PM PDT, ID: 21641216

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628