且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在MS Access中选择一个范围内的所有日期

更新时间:2023-10-06 12:33:10

创建查询或表格以生成覆盖您整个范围的日期,并应用与现在相同的过滤器.

Create a query or table that produces dates covering your entire range and apply the same filter as now.

然后创建一个新查询,以表/查询为源,并在日期字段上方对您的查询进行左外部联接.

Then create a new query with table/query as source and with an left outer join to your query above on the field Date.

这将返回您的计数,现在为空,缺少的日期为Null.如果您希望Null为零,请使用Nz(CountField, 0).

That will return your count as now and Null for the missing dates. Use Nz(CountField, 0) if you want zeroes for Null.

附录:

可以在此处