访问 table 中的表达式

Access expressions in table

我会在 table 中收集我的 IIF 或 switch 表达式作为记录(超过 40 个):

tbl_filter:

过滤器

Description LIKE '*SCREW*',"Screw"

Description LIKE '*SOCKET*',"SScrew"

如何在查询的切换函数中使用 tbl_filter 中的表达式集合?

类似这样:

SELECT Item, switch(Select * from tbl_Filter) AS Cathegory FROM tbl_Materials

提前感谢您的帮助

我想你的意思类似于下面的意思。

tbl_Filter

Contains    Filter
Screw       Screw
Socket      Sscrew

tbl_Main

Description
Screws and sockets
Screw
Socket

查询SQL

SELECT tbl_Main.Description, tbl_Filter.Filter
FROM tbl_Main, tbl_Filter
WHERE tbl_Main.Description Like "*" & [Contains] & "*"

结果

Description         Filter
Screws and sockets  Screw
Screws and sockets  Sscrew
Screw               Screw
Socket              Sscrew