Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Diff (2003)

    I have a Date diff formula that calculates the difference of 2 fields that are formatted as General Date and it brings back days. How can I get it to bring the days back in a format such as 1.2 ?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Date Diff (2003)

    Sorry for the length of the formula but this will calculate the date to 2 decimal places:

    =IIf(IIf(DateDiff("n",[datein],[dateout]) Mod 60=0,DateDiff("h",[datein],[dateout]),DateDiff("n",[datein],[dateout])/60)>=0,IIf(DateDiff("n",[datein],[dateout]) Mod 60=0,DateDiff("h",[datein],[dateout]),DateDiff("n",[datein],[dateout])/60),0)


    <img src=/S/drop.gif border=0 alt=drop width=23 height=23>
    Jerry

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Date Diff (2003)

    Instead of using the DateDiff, just subtract one date from the other, then round the result to 2 dec places. e.g.

    Difference : Round([DatePaid]-[InvDate],2)

    Dates are stored as numbers, with whole numbers representing days, and the decimal paart representing the time.
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Diff (2003)

    Thanks for both the responses. I will try the latter due to simplicicty.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •