Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to get the right date

Author  Topic 

ronnyr
Starting Member

21 Posts

Posted - 2006-10-09 : 19:07:54
Hi all,

I am trying to get the date difference from the day it being orders to the date it being shipped.

I am doing something like this, but it still returns the wrong result:

DaysLate = CONVERT(INT, DATEPART(dd, o.DueDT)) - CONVERT(INT, DATEPART(dd, GetDate()))

Is anyone can help me with this?

Thanks in advance.


Ron.

“Know where to find the information and how to use it - That's the secret of success”

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-09 : 19:10:37
Use DATEDIFF function instead.

Tara Kizer
Go to Top of Page
   

- Advertisement -