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
 SQL Server Development (2000)
 How can I do DATE minus DATE ?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-03 : 09:59:38
gu writes "Hello SQL Team,
I am using DTS to transfer data from a table to another.
While doing data transferring I hope to do some data mapping (by VBScript) in it.
The problem is I hope to calculate "how many days" between 2 DATE fields (one is system current date, one is from source table field) in a table and put it into the destination table field

many many thanx

Environment:
MS SQL Server 2000 Enterprise Edition
MS Windows 2000 Advance Server"

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2002-04-03 : 10:02:05
you can use the DATEDIFF function


SELECT DATEDIFF(dd, GetDate(), source.DateField) as DayDifference FROM Source


Go to Top of Page
   

- Advertisement -