使用OR vs IIF来限制记录 [英] Using OR vs IIF to limit records

查看:144
本文介绍了使用OR vs IIF来限制记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



此脚本对多个OR语句返回true,导致返回的记录太多。如果第一个匹配,我希望它停止。我在想这应该是一个IIF语句(而不是像我在这里所做的那样使用OR ... AND)但不确定如何将它放入WHERE子句中。

Hi,
This script is returning true for more than one OR statement, resulting in too many records being returned. I want it to stop if the first one is a match. I''m thinking that should be an IIF statement (instead of using OR... AND as I''ve done here) but not sure of how to fit that into a WHERE clause.

展开 | 选择 < span class =codeDivider> | Wrap | 行号

推荐答案

@webbeacon:请提供更多关于数据结构的信息,表你的领域,你打算做什么?


我们可以理解代码,但不能猜到你想做什么,所以你应该在之前提供更多细节我们可以开始帮助你,谢谢。
@webbeacon: please give more information bout your data structure, Table''s fields, and what are you planning to do ?

We can understand the code, but can''t guess what you want to do, so you should provide more detail before we can start to help you, thanks.


感谢hvsummer - 基本上我正在尝试在两个列表中对名字和姓氏进行近似匹配。我认为表结构在SELECT语句中有解释,所以我不确定你在这方面要找什么...对不起我是新来的!


basAlphNum功能是我发现的公共功能剥去所有空格和标点符号。我正在使用MID将匹配部分限制为5个字符。存在这两种情况以捕捉两个列表之间的差异(即,Marie Louise与Marie-Louise对比Marie)


随着添加第15和第17行,我希望通过首先包含只是名字或者姓名的比赛来扩大我的网络,然后我首先完成了这四个组合......但是我得到了很多重复的比赛。


我的天空中的馅饼是为了达到这个程度,我不需要对任何一个列表进行任何手动修改以使其工作,或者至少将它们保持在最低限度。


希望帮助

谢谢!
Thanks hvsummer - basically I''m trying to do an approximate match of first and last names in two lists. I think the table structure is explained in the SELECT statement so I''m not sure what you''re looking for in that regard... sorry I''m new here!

The basAlphNum function is a public function I found that strips out all spaces and punctuation. I''m using MID to restrict the matching portion to 5 characters. These two things exist to capture differences between the two lists (ie. "Marie Louise" vs. "Marie-Louise" vs. "Marie")

With the addition of lines 15 and 17, I was hoping to widen my net by including matches for just first or last names, after having gone through the four combinations first... but then I''m getting a lot of duplicate matches.

My "pie in the sky" is to get this to a point where I don''t need to do any manual modifications to either list for it to work, or at least keep them to a minimum.

Hope that helps
Thank you!


这里这是问题的一个例子。我隐藏了部分名称字段以保护隐私,但您可以看到突出显示的记录是正确的匹配;下面的所有记录都是不正确的匹配。


我希望我可以修改它,当它匹配时,它会停止查看其余的OR语句从而避免重复。希望这是有道理的。
Here''s an example of the problem. I''ve hidden part of the name fields for privacy but you can see the highlighted record is a correct match; all the records below that are incorrect matches.

My hope is that I can modify this in such a way that when it makes a match, it stops looking through the rest of the OR statements, thereby avoiding duplicates. Hope that makes sense.


这篇关于使用OR vs IIF来限制记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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