Solved

TSQL - Length of days between two dates

Posted on 2008-10-15
2
677 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now