2
Contributors
4
Replies
5
Views
11 Years
Discussion Span
Last Post by bradleyc
0

How would you calculate the difference between two dates?

use DATEDIFF(datepart,startdate,enddate)
the datepart is the part of the date you want the difference of, days, months, years.

0

so apparently i do something like ..
SELECT DATEDIFF(dd, '12/5/2002 22:00', '12/6/2002 09:00')

can i do something like
SELECT DATEDIFF(dd, DateOfRego, CaseClosed)

0

so apparently i do something like ..
SELECT DATEDIFF(dd, '12/5/2002 22:00', '12/6/2002 09:00')

can i do something like
SELECT DATEDIFF(dd, DateOfRego, CaseClosed)

you can do that, so long as you assign appropriately either pl-sql, PHP or ASP. What are you running on??

sample...
DateOfRego="12/5/2002 22:00"
CaseClosed="12/6/2002 09:00"


SELECT DATEDIFF(dd, '" & DateOfRego & "', '" & CaseClosed & "')

0

DateOfRego="12/5/2002 22:00"
CaseClosed="12/6/2002 09:00"

What if thet are based simply on dates, no times?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.