Solved

Calculate the number of days in a date range in SQL 2005

Posted on 2009-07-14
3
170 Views
Last Modified: 2012-05-07
How can I determine how many days are in @StartDate and @EndDate with  a SQL expression?
0
Comment
Question by:mattkovo
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 24851614
SELECT DATEDIFF(dd,@Start, @End )
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 24851636
Aneesh's suggestion should work for you!
0
 

Author Closing Comment

by:mattkovo
ID: 31603355
Thanks a bunch!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question