Hi all,
I need to calculate the difference between two dates in a table, but I need the result accurate to a couple of decimal points (example 2.53). I'd like to do something like:
Select DATEDIFF(yy, Date1, Date2) as MyDifference
but of course DATEDIFF() returns an integer, thereby losing the decimals.
Has someone already written a fancy Select statement, or perhaps a handy UDF, that can provide the result I need?
many thanx,
bp
P.S. Solution neeeds to take leap years into account (of course).
I need to calculate the difference between two dates in a table, but I need the result accurate to a couple of decimal points (example 2.53). I'd like to do something like:
Select DATEDIFF(yy, Date1, Date2) as MyDifference
but of course DATEDIFF() returns an integer, thereby losing the decimals.
Has someone already written a fancy Select statement, or perhaps a handy UDF, that can provide the result I need?
many thanx,
bp
P.S. Solution neeeds to take leap years into account (of course).