Results 1 to 4 of 4

Thread: Formula

  1. #1
    Join Date
    Jan 2004
    Posts
    106

    Unanswered: Formula

    the following formula finds all books that were returned late and works out how many days late they are:

    Days Late: IIf([Date Returned]<[Date Due Back],DateDiff("d",[Date Returned],[Date Due Back]))

    how do i make it display 0 in "Days Late" if the book was returned on or before the date it was due back?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Formula

    Originally posted by craig_dixon
    the following formula finds all books that were returned late and works out how many days late they are:

    Days Late: IIf([Date Returned]<[Date Due Back],DateDiff("d",[Date Returned],[Date Due Back]))

    how do i make it display 0 in "Days Late" if the book was returned on or before the date it was due back?
    IIf([Date Returned]<[Date Due Back],0,DateDiff("d",[Date Returned],[Date Due Back]))

  3. #3
    Join Date
    Jan 2004
    Posts
    106
    that formula works for the dates that are the same but if a date in teh "date ruturned" field is less than in the "date due back" field then a minus number appears in "days late", whereas i wan a 0 to appear here aswel

  4. #4
    Join Date
    Dec 2003
    Location
    Toronto, Ont. Canada
    Posts
    238
    Originally posted by craig_dixon
    that formula works for the dates that are the same but if a date in teh "date ruturned" field is less than in the "date due back" field then a minus number appears in "days late", whereas i wan a 0 to appear here aswel
    How about this...

    Days Late: IIf(DateDiff("d",[Date Returned],[Date Due Back])<=0,0,DateDiff("d",[Date Returned],[Date Due Back]))

Posting Permissions

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