Solved

TSQL - Length of days between two dates

Posted on 2008-10-15
2
708 Views
Last Modified: 2008-10-15
I have a table that contains dates when the record was created.  Using a T-SQL query how would I be able to figure out how many days have passed since that record was created.  For example GETDATE() - RecordCreatedDate = Number of Days.

Any help is appreciated.  Thanks!
0
Comment
Question by:RTCexpert
  • 2
2 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22724464
dateadd(d, recordcreated,getdate())
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 250 total points
ID: 22724467
sorry... datediff

datediff(d, recordcreated,getdate())
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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