【发布时间】:2014-06-23 16:21:37
【问题描述】:
试图在 MS Access 中提出 SQL 查询,但空值和聚合函数让我难过。任何帮助表示赞赏。
查询以显示 TABLE1 中 EditDate(可能为空)大于 TABLE2 中的最大 LastImportDate 的记录。
表 1
字段名称 - 数据类型 ReportID - 编号 EditDate - 日期/时间
表2
字段名称 - 数据类型 LastImportDate - 日期/时间
谢谢。
【问题讨论】:
-
COALESCE或ISNULL在 Access 的 SQL 中工作吗?如果EditDate是NULL,你想忽略它吗?你可能会使用类似... where ISNULL(TABLE1.EditDate, '1970-01-01') > TABLE2.LastImportDate... -
这是link 或在 MS Access 中使用
ISNULL。像这样的东西:... where IIF(ISNULL(TABLE1.EditDate), '1970-01-01', TABLE1.EditDate) > TABLE2.LastImportDate...
标签: sql ms-access-2013