none
if then else or where clause? RRS feed

  • Question

  • Hello,

    I'm trying to create a query that returns a fields values based on 1 of 2 conditions.

    First: If the "start time" (control on a form) is less than the MinOfStartTime then the values returned for the "end time" must be <=MinOfStartTime

    or: If the "start time" (control on a form) is greater than the MaxOfEndTime then the values returned for the "end time" must be >=MaxOfEndTime

    I'm not quite sure how to build this into the criteria.

    Thanks for any help.

    Andrew

    Tuesday, September 27, 2016 5:28 PM

Answers

  • Hi moosejaa,

    According to your description, You can use IIf anywhere you can use expressions. You use IIf to determine if another expression is true or false. If the expression is true, IIf returns one value; if it is false, IIf returns another. You specify the values IIf returns.

    For more information, please refer to IIf Function

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:34 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:39 PM
    Wednesday, September 28, 2016 1:55 AM

All replies

  • Hi moosejaa,

    According to your description, You can use IIf anywhere you can use expressions. You use IIf to determine if another expression is true or false. If the expression is true, IIf returns one value; if it is false, IIf returns another. You specify the values IIf returns.

    For more information, please refer to IIf Function

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:34 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:39 PM
    Wednesday, September 28, 2016 1:55 AM
  • Hi Andrew, What do you want returned if the start time is greater than the Min but less than the Max?
    Wednesday, September 28, 2016 8:26 AM