在一个字段上使用多个条件查询 [英] Query using multiple criteria on one field

查看:79
本文介绍了在一个字段上使用多个条件查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是XP上Access 2000的初级用户。


我正在尝试创建查询来自1300多条记录的表格。我需要通过他们的SSN查找个人,这是表的主键)我需要一次查找几个。此外,每次运行此查询时,我都会查找不同的人。


这是SQL:

Hi everyone,

I am a beginning to intermediate user with Access 2000 on XP.

I am trying to create a query from a table of more than 1300 records. I need to look up individuals by their SSN only which is the primary key for the table) and I need to look up several at a time. Also, I will be looking up different individuals every time I run this query.

This is the SQL:

展开 | 选择 | Wrap | 行号

推荐答案

您需要创建一个可以处理多个条件的搜索表单。幸运的是,您可以下载以下链接中的一个示例。该链接包含详细说明,希望能够适应您的应用程序。

http://allenbrowne.com/ser-62。 html
You need to create a search form that can handle multiple criteria. Fortunately, there is an example of one at the following link that you can download. The link contains detailed instructions, and hopefully be able to adapt to your application.

http://allenbrowne.com/ser-62.html


我检查了你的链接,它比我能理解的更复杂。我不是在寻找一系列SSN,而是特定的SSN。是不是有办法在该字段中放置一个参数,标准为[输入SSN],然后输入123456789和987654321和555121212 ...。等...我需要找到多少人?
I checked out your link and it''s more complicated than i can understand yet. I''m not looking up a range of SSN''s but specific SSN''s. Isn''t there a way to put a parameter in that field Criteria stating to [Enter SSN] and then enter "123456789 and 987654321 and 555121212..." etc... for as many people as I need to find?



我检查了你的链接,它比我能理解。我不是在寻找一系列SSN,而是特定的SSN。是不是有办法在该字段中放置一个参数,标准为[输入SSN],然后输入123456789和987654321和555121212 ...。等......我需要找到多少人?
I checked out your link and it''s more complicated than i can understand yet. I''m not looking up a range of SSN''s but specific SSN''s. Isn''t there a way to put a parameter in that field Criteria stating to [Enter SSN] and then enter "123456789 and 987654321 and 555121212..." etc... for as many people as I need to find?



a快捷简单的方法是创建一个表来放置你的ssn''s

然后在你的查询中,你可以使用


select * from table1 where ssn IN(从ssntable选择ssn)

a quick easy way would be to create a table to put your ssn''s

then in your query, you can use it

select * from table1 where ssn IN(Select ssn from ssntable)


这篇关于在一个字段上使用多个条件查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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