Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    2

    Unanswered: Date Expressions

    I'm trying to figure the difference between two dates in a form using the table field in the following expression which is in the control source of DaysStored

    =DateDiff("d",[TowedDate],Date())

    This is working properly.

    My problem is that I need to have an expression that takes into account the ReleaseDate and if this date is less than Todays date the field needs to be filled with the difference between TowedDate and ReleaseDate.

    Sorry if this seems like a simple question but I'm about 4 days into working with Access 2002 and this is a bit confusing.

    Thanks, Chris

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Date Expressions

    Try an IIf infront of this

    IIF([ReleaseDate] > Date(), DateDiff("d",[TowedDate],Date()), DateDiff("d",[TowedDate],[ReleaseDate])

    Also check my parentheses and brackets ... think I might have left out one ...

    Originally posted by Interstate
    I'm trying to figure the difference between two dates in a form using the table field in the following expression which is in the control source of DaysStored

    =DateDiff("d",[TowedDate],Date())

    This is working properly.

    My problem is that I need to have an expression that takes into account the ReleaseDate and if this date is less than Todays date the field needs to be filled with the difference between TowedDate and ReleaseDate.

    Sorry if this seems like a simple question but I'm about 4 days into working with Access 2002 and this is a bit confusing.

    Thanks, Chris
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

Posting Permissions

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