Bradley Connor
Grasshopper
Points: 10
More actions
October 23, 2005 at 6:54 pm
#88204
How would you calculate the difference between two dates?
October 23, 2005 at 7:48 pm
#599409
Apparently i should use DATEDIFF ... how do i use DATEDIFF?
SQLBill
SSC Guru
Points: 51440
October 24, 2005 at 7:05 am
#599459
DATEDIFF(datepart, startdate, enddate)
Example: SELECT DATEDIFF(d, '2005-10-01', GETDATE())
Refer to the BOL for more information.
-SQLBill
Greg Charles
SSC-Forever
Points: 45403
October 24, 2005 at 9:26 am
#599551
Bradley,
If, as your subject suggests, you're trying to do this in Oracle, you don't have to use a function at all. Just subtract the dates. See this link:
http://asktom.oracle.com/~tkyte/Misc/DateDiff.html
Greg
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply