|
本帖最后由 excessstone 于 2011-9-1 18:35 编辑
在那个查询的设计模式下
条件栏里,原来是 like。。。。
改成 is null or like。。。。
全都改
意思是如果表中数据本身是空的,就符合条件,如果不为空,就继续判定 like 表达式
该查询的sql语句
SELECT table.ID, table.Name, table.Gender, table.[Job objective], table.Education, table.College, table.Specialty, table.Email, table.Tel, table.Channel, table.Interview, table.Comments, table.Resume
FROM [table]
WHERE (((table.Name) Is Null Or (table.Name) Like "*" & [Forms]![frm]![Name] & "*") AND ((table.Gender) Is Null Or (table.Gender) Like "*" & [Forms]![frm]![Gender] & "*") AND ((table.[Job objective]) Is Null Or (table.[Job objective]) Like "*" & [Forms]![frm]![Job objective] & "*") AND ((table.Education) Is Null Or (table.Education) Like "*" & [Forms]![frm]![Education] & "*") AND ((table.College) Is Null Or (table.College) Like "*" & [Forms]![frm]![College] & "*") AND ((table.Specialty) Is Null Or (table.Specialty) Like "*" & [Forms]![frm]![Specialty] & "*") AND ((table.Interview) Is Null Or (table.Interview) Like "*" & [Forms]![frm]![Interview] & "*"));
还有个小建议,就是变量名不要使用 name,或者其他内置关键字。也许会有潜在问题。
变量名也不要有空格,这样省事。 |
|