当前位置:网站首页>SQL multi condition query cannot be implemented
SQL multi condition query cannot be implemented
2022-07-24 12:02:00 【CSDN Q & A】
On Error Resume Next
Dim i As Integer, j As Integer
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim sql4 As String
With conn
.ConnectionString = "Provider=microsoft.ace.oledb.12.0;data source=" & ThisWorkbook.Path & "\ Price evaluation management system .accdb"
.Open
End With
sql1 = "select * from Summary of appraisal information where ( Picture number like '%" & aa1.Value & "%') Or ( name like '%" & aa1.Value & "%') or ( roughcast X like '%" & aa1.Value & "%')"'sql2 = "select * from Summary of appraisal information where ( roughcast X like '%" & aa2.Value & "%')"'sql3 = "select * from Summary of appraisal information where ( roughcast Y like '%" & aa3.Value & "%')"'sql4 = "select * from Summary of appraisal information where ( roughcast Z/ The diameter of like '%" & aa4.Value & "%')"'sql = "select * from Summary of appraisal information where Picture number like '%" & aa1.Value & "%'"'or ( roughcast X like '%" & aa2.Value & "%') or ( roughcast Y like '%" & aa3.Value & "%')or( roughcast Z like '%" & aa4.Value & "%')rs.Open sql1, conn, adOpenKeyset, adLockOptimisticrs.Open sql2, conn, adOpenKeyset, adLockOptimisticrs.Open sql3, conn, adOpenKeyset, adLockOptimisticrs.Open sql4, conn, adOpenKeyset, adLockOptimistic As the picture shows , Yes 4 Condition input boxes , The first one is to input the drawing number and name to query , second 、 3、 ... and 、 Four input X,Y,Z Query data , What I want to achieve is that the four query conditions can filter queries from each other , The input “ Cover plate ” Input after filtering X,Y,Z Sequential filtering , You can also enter it first X,Y,Z Enter the value after filtering “ Cover plate ” It can also filter queries , Nested queries , Who can point out how to do ? At present, only sql1 The filtering effect of , The later implementation is not
Copyright notice : This paper is about CSDN Blogger 「weixin_44370039」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/weixin_44370039/article/details/125808305

边栏推荐
- 【网络空间安全数学基础第9章】有限域
- Share the typora tool
- Shell script "< < EOF" my purpose and problems
- [C and pointer Chapter 11] dynamic memory allocation
- Makefile quick use
- 【C和指针第14章】预处理器
- The difference between where and having
- Using huggingface model to translate English
- Delphi gexperts expert instructions for improving development efficiency
- PM's alarm: "NPM warn config global --global, --local are deprecated
猜你喜欢

Dynamic memory management

在kuborad图形化界面中,操作Kubernetes 集群,实现mysql中的主从复制
![Operational amplifier - Notes on rapid recovery [II] (application)](/img/fd/e12f43e23e6ec76c2b44ce7813e204.png)
Operational amplifier - Notes on rapid recovery [II] (application)
![[data mining engineer - written examination] sheen company in 2022](/img/67/c61dfce8c397ab55fab835b6e81a5f.jpg)
[data mining engineer - written examination] sheen company in 2022

Introduction to Devops and common Devops tools

【C和指针第14章】预处理器

3、 Implementation principle of MFC message mapping mechanism

L1-059 敲笨钟

Jmeter-While控制器

Convergence rules for 4 * 4 image weights
随机推荐
Shell script "< < EOF" my purpose and problems
The third day of hcip mGRE experiment
Hash - 349. Intersection of two arrays
Grep actually uses ps/netstat/sort
Threat hunting collection
Types and history of bugs in it circle
[data mining engineer - written examination] sheen company in 2022
Hash - 202. Happy number
Operational amplifier - Notes on rapid recovery [1] (parameters)
Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]
【C和指针第14章】预处理器
第1章 引言
Introduction to Devops and common Devops tools
Shell script
Install MariaDB columnstore (version 10.3)
Use and expansion of fault tolerance and fusing
A* and JPS
The difference between synchronized and lock locks
Why is the datetime type field 8 hours earlier when I use flinkcdc to read MySQL's binlog?
String - 541. Reverse string II