Results 1 to 2 of 2
  1. #1
    AussieGal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    56

    DateDiff to include start date

    Hi, I have a Continuous form where I am trying to add a calculated feild that allows us to see how many days a client was in hospital. There is a start and end date. I want to see the following: If start date and end date are the same, this should show client in hospital for 1 day, not the default of 0. If start date 5/1/13 and end date is 5/3/13 it should show 3 days in hospital. If start date is 5/1/13 and there is no end date, this should show 7 dates (from start date to today's date or current date). Currently I have =DateDiff("d",[EStartDate],[EEndDate])-([EStartDate]=[EEndDate]) but it only shows 1 if the start date and end date is the same. I need it to include the start and end dates typed in its equation. I hope that makes sense and someone can help with the answer.

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Why not just add one to the result? You can use the Nz() function to replace a Null end date with the current date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date search results wont include selected dates.
    By UserJohn7673 in forum Queries
    Replies: 3
    Last Post: 09-21-2012, 11:42 PM
  2. Replies: 15
    Last Post: 04-06-2012, 10:57 AM
  3. OutputTo Macro Include today's date
    By Lorlai in forum Access
    Replies: 2
    Last Post: 09-27-2011, 01:42 PM
  4. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  5. Convert date format yyyymmdd for datediff
    By TEN in forum Programming
    Replies: 1
    Last Post: 06-17-2009, 09:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums