Results 1 to 6 of 6
  1. #1
    gonzod is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    5

    Need Help with Datediff


    Need help quickly and I know this is a no brainer for everyone on this site.
    What I have is an Access database with Case Opened, Case Closed and Days Open. What I did was use the Datediff to get the total days when Case Opened and Case Closed are populated and it worked but now I need it to populate the Days Open with the total days when Case Opened is filled and no date is in Case Closed. Basically I need it to count the days it is open using current date with the date it was opened. I know this is all jammed together but I am in a hurry. Thanks for any help!!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    datediff("d",caseOpenDate,now()) returns days since case open till now.

  3. #3
    gonzod is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    5
    This is what I have now

    =DateDiff("d",[Case Open],[Case Closed])

    can i combine them both to also count when case not closed?

  4. #4
    DaveT is offline Access Developer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    May 2010
    Location
    Texas
    Posts
    69
    IIF(IsDate([CaseClosed]), DateDiff("d",[Case Open],[Case Closed]), DateDiff("d",[Case Open],Date())

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Or
    =DateDiff("d",[Case Open],nz([Case Closed],now))

  6. #6
    gonzod is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    5
    Thanks Guys for all your help!!!

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

Similar Threads

  1. Datediff
    By greggue in forum Queries
    Replies: 2
    Last Post: 08-13-2010, 03:53 PM
  2. Building a Difficult DateDiff Expression
    By jma108 in forum Queries
    Replies: 0
    Last Post: 06-15-2009, 12:39 PM
  3. Change Between by DateDiff or DateAdd.
    By wagner.bts in forum Queries
    Replies: 1
    Last Post: 06-05-2009, 11:24 AM
  4. DateDiff function
    By Scott R in forum Reports
    Replies: 5
    Last Post: 12-03-2008, 07:32 AM
  5. Datediff() help needed
    By geoff44 in forum Access
    Replies: 2
    Last Post: 11-20-2008, 04:44 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