Solved

TSQL - Length of days between two dates

Posted on 2008-10-15
2
714 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

In this article I will describe the Detach & Attach 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.
In this article I will describe the Backup & Restore 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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 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