Solved

TSQL - Length of days between two dates

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stored Proc - Rewrite 42 75
SSRS: Why is Visual Studio stripping these properties? 2 49
Connect to SQL 2008 r2 server over the Internet 4 74
t-sql left join 2 26
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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