查询中的IIF使用“<”<"标志 [英] IIF in query using "<" sign

查看:132
本文介绍了查询中的IIF使用“<”<"标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用嵌入式If语句在查询中选择某些记录。我想给我们一个<在声明中但是看不到有关如何执行此操作的任何信息。


IIF声明是

I''m trying to select certain records in a query using an embedded If statement. I want to us a "<" in the statement but can''t see any information on how to do this.

The IIF statement is

展开 | 选择 | Wrap | 行号

推荐答案

Reginald,


使用IIF语句时,必须在第一个参数中包含条件语句。如果是这样,IIF语句将返回第二个参数。如果第一个条件语句为false,则IIF语句将返回第三个参数。


在您的示例中,您实际上是要求您的语句评估第二个参数,该参数将返回结果是真还是假。


IIF声明没有做什么,它只返回一个值。


有很多方法可以在查询中包含条件。我做的一种方法是首先评估你的标准,其中IIF返回true或false,然后只选择那些真(或假)的记录。
Reginald,

When using an IIF statement, you must have the conditional statement in the first argument. If that is true, the IIF statement will return the second argument. If the first conditional statement if false, the IIF Statement will return the third argument.

In your example, you are essentially asking your statement to evaluate the second argument, which will return either a true or false result.

The IIF statement does not "do" anything, it just returns a value.

There are ways to have conditionals in your queries. One way I have done it is to evaluate your criteria first, where the IIF returns a true or false, then select only those records which are true (or false).


这是一个考试我扔了一起(我希望我的所有括号都正确...)


在您的查询中,这应该是您的一个领域:


Here is an exam ple I threw together (I hope I got all the parentheses correct...)

In your query, this should be one of your fields:


展开 | 选择 | Wrap | 行号


不需要使用IIf()。你可以或你的条件。
There''s no need to use IIf(). You can just OR your conditions.


这篇关于查询中的IIF使用“&lt;”&lt;&quot;标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆