Question

Locked

DATEDIFF FUNCTION

By tytyu67567 ·
Hi,

Im a developer. I have a question on the DATEDIFF function, hope you can help me out. Im using DATEDIFF function, I know that it will result in integer value. But, I need the result in decimals.

For example :

STARTDATE ENDATE RESULT
8/27/2003 9/2/1976 26.11
9/1/2003 1/6/2000 3.8


CAN YOU PLEASE HELP ME ?

THANKS IN ADVANCE

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

What if

by LocoLobo In reply to DATEDIFF FUNCTION

you set the interval to days and divide by 365.25 store it in a decimal (single) variable?

Is this VB?

Collapse -

Do datediff in days

by Tony Hopkinson In reply to DATEDIFF FUNCTION

and divide by 365.
Should be near enough.

Collapse -

Another way

by rwidegren In reply to DATEDIFF FUNCTION

If you want the result to be the number of years to the left of the decimal and the number of months to the right (as a whole number) then you could do the DateDiff in months and divide by 12. The integer part would be the years and the Mod would be the extra months.

Back to Software Forum
4 total posts (Page 1 of 1)  

Software Forums