查询表达式 [英] Query Expressions

查看:73
本文介绍了查询表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!


我有一个查询,在运行时显示所有特殊需求记录。此查询从链接的ODBC表中获取其信息。我在数据库中有一个单独的表(特殊需要的学生),其中包含类似的信息,但仅限于当前学年(然后用于其他各种功能)。我希望能够做的是在查询中有一些表达式,它将插入文本存在于数据库中。如果链接表中的记录已经在表中特殊需要学生,则进入查询的新字段;如果没有,将该字段留空。我已经尝试过使用iif和其他东西,但我不是很擅长它,所以不断收到语法错误。


我只是想知道这是否可能,如果是的话,你使用什么样的表达方式?


如果你还需要更多info让我知道。


非常感谢!

Hi there!

I have a query which when run shows all the special needs records. This query gets its information from a linked ODBC table. I have in the database a seperate table (special needs students) which contains similar information but only for the current academic year (which is then used for various other functions). What I want to be able to do is have in the query some sort of expression that will insert the text "exists in database" into a new field of the query if the record in the link table is already in the table special needs students; and if not, leaving the field blank. I''ve tried using iif and other things but i''m not very good at it so keep getting syntax errors.

I''m just wondering if this is possible and if so what kind of expression do you use?

If you need any more info let me know.

Help greatly appreciated!

推荐答案

创建一个查询,显示链接表中的所有行加入表格中的匹配行[特殊需要的学生]。在查询中包含[特殊需求学生]中的字段,如果没有匹配的记录,该字段对于该记录将为空。现在,您可以创建一个新列:
Create a query that will show all rows from the link table joined with matching rows from the table [special needs students]. Include a field from [special needs students] in your query, and if there isn''t a matching record, that field will be null for that record. Now you can create a new column with:
展开 | 选择 | Wrap | 行号


感谢您的快速回复!我得到错误表达式包含错误的参数数量。链接表比特殊需要的学生有更多的字段。抱歉,我没有意识到。根据我对数据库的了解,我认为这意味着它不可能,因为它们都需要相同数量的字段才能工作。无论如何,谢谢你的帮助!非常感谢
thanks for the quick response! i get the error the expression contains the wrong number of arguments. The link table has more fields than the special needs students one. sorry i didn''t realise. From what I know about databases I think that means it''s not possible as they both need the same number of fields to work. Thank you anyway for your help! Much appreciated


提供的答案芯片非常正确(如果我挑剔我可能会提到空白值通常指定为而不是" )。如果它不适合你,我怀疑你可能会错误地转录它。


为什么你不发布你所拥有的内容我们会看到我们是否会可以发现问题。
The answer Chip supplied is pretty much correct (If I were being picky I may mention the blank value is normally specified as Null instead of ""). If it''s not working for you I suspect you may have transcribed it with an error.

Why don''t you post what you have and we''ll see if we can spot the problem.


这篇关于查询表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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