Excel VBA @SQL 字符串过滤器多个 LIKE 条件

编程入门 行业动态 更新时间:2024-10-27 16:24:37
本文介绍了Excel VBA @SQL 字符串过滤器多个 LIKE 条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码按预期工作,但我还需要在主题行中排除 Autoreplies 和其他一些字符串.我需要知道是否可以再添加 2 或 3 个赞.

This code works as intended but I also need to exclude Autoreplies and some other strings in a subject line. I need to know if it's possible to add 2 or 3 more Likes.

我尝试了 And 和 Or 条件,但出现解析错误.

I tried And and Or conditions but I'm getting a parse error.

以下代码有效.我只需要在无法交付后添加另一个字符串条件."喜欢'%自动回复%'".

This code below works. I just need to add another string condition after undeliverable. " Like '%Automatic reply%'".

Filter = "@SQL=" & " Not " & _
             "urn:schemas:httpmail:subject" & "" & _
             " Like '%undeliverable%'"

谢谢.

推荐答案

OR 应该可以,下面的例子要么有%undeliverable%%自动回复%

Filter = "@SQL=" & " Not (urn:schemas:httpmail:subject" & _
                   " Like '%undeliverable%'  Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Automatic reply%')"

<小时>

再添加一个过滤器


To Add one more Filter

Filter = "@SQL=" & " Not (urn:schemas:httpmail:subject" & _
                   " Like '%undeliverable%'  Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Automatic reply%' Or " & _
                         "urn:schemas:httpmail:subject" & _
                   " Like '%Bla Bla%')"

这篇关于Excel VBA @SQL 字符串过滤器多个 LIKE 条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-29 12:56:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/756082.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   过滤器   字符串   条件   Excel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!