Results 1 to 7 of 7
  1. #1
    Join Date
    May 2011
    Location
    New Zealand
    Posts
    11

    Unanswered: Query: If expression using dates

    I am trying to run an IF EXPRESSION? query which basically needs to say:

    IF there is a date in this field, "IN" should be displayed. If there is no date in this field, OUT should be displayed.

    I can get this to work with text datatype but not with a date. I guess the problem is the word "blank"?

    The expression I used is: iif([ReturnDate] = "blank","OUT", "IN")

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Try using IsDate(). You're testing for the literal string "Blank".
    Paul

  3. #3
    Join Date
    May 2011
    Location
    New Zealand
    Posts
    11

    Query: If expression using dates

    Thanks. I will give that a go!

  4. #4
    Join Date
    May 2011
    Location
    New Zealand
    Posts
    11

    Query: If expression using dates

    I've played around with this, but I'm not sure where to put the IsDate() into my formula. I'm so new at this its ridiculous!

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    IIf(IsDate([ReturnDate]), "IN", "OUT")

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    May 2011
    Location
    New Zealand
    Posts
    11

    Query: If expression using dates

    That worked! THANKS!

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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