Question

  • Creator
    Topic
  • #2255469

    DATEDIFF FUNCTION

    Locked

    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

All Answers

  • Author
    Replies
    • #2538514

      Clarifications

      by tytyu67567 ·

      In reply to DATEDIFF FUNCTION

      Clarifications

    • #2538490

      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?

    • #2538386

      Do datediff in days

      by tony hopkinson ·

      In reply to DATEDIFF FUNCTION

      and divide by 365.
      Should be near enough.

    • #2539997

      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.

Viewing 3 reply threads