【问题标题】:Is there a way to include null values along with selected values in query有没有办法在查询中包含空值和选定值
【发布时间】:2023-02-07 04:49:53
【问题描述】:

过滤多个类别时,我试图向当前连接的字符串添加一个新过滤器,以更新已选择的内容,但也将空值包含到 sql 语句中。我试过 (query += query & color = selected OR query & color Is Null,但它最终只获取非空值。

这是我尝试过的一个例子

If Nz(colorFilter, "-") <> "All" Then
    query = query & " AND Color Is Null OR Color=" & Chr(34) & Me.colorFilter & Chr(34) & query
End If

【问题讨论】:

    标签: vb.net ms-access


    【解决方案1】:

    尝试这个:

    query = query & " AND (Color Is Null OR Color = " & Chr(34) & Me.colorFilter & Chr(34))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-30
      • 1970-01-01
      • 2020-05-29
      相关资源
      最近更新 更多