【Access特定日期取值方法】计算并显示特定日期值
时 间:2021-08-20 19:49:50
作 者:杨雪 ID:42182 城市:南京
摘 要:由于“日期”值存储为双精度数,因此当您试图在表达式中使用“日期”值时,可能会得到格式不正确的结果。 本主题说明如何创建表达式和自定义函数,以显示特定日期并计算时间间隔。
正 文:
当前月
DateSerial(Year(Date()), Month(Date()), 1)
下月
DateSerial(Year(Date()), Month(Date()) + 1, 1)
当月的最后一天
DateSerial(Year(Date()), Month(Date()) + 1, 0)
DateSerial(Year(Date()), Month(Date()) + 1, 0)
下个月的最后一天
DateSerial(Year(Date()), Month(Date()) + 2, 0)
上个月的第一天
DateSerial(Year(Date()), Month(Date())-1,1)
上个月的最后一天
DateSerial(Year(Date()), Month(Date()),0)
本季度的第一天
DateSerial(Year(Date()), Int((Month(Date()) - 1) / 3) * 3 + 1, 1)
本季度的最后一天
DateSerial(Year(Date()), Int((Month(Date()) - 1) / 3) * 3 + 4, 0)
假设星期日 = 第 1 天 (一周的第一天)
Date() - WeekDay(Date()) + 1
本周的最后一天
Date() - WeekDay(Date()) + 7
Access软件网官方交流QQ群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access窗体导出PDF】...(04.08)
- 【Access窗体导出PDF】...(04.07)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
学习心得
最新文章
- Access学习笔记--用Acce...(04.19)
- 【Access重复项查询示例】将A...(04.17)
- Access快速开发平台企业版--...(04.16)
- 【Access模块示例】通过模块代...(04.15)
- Access查询里面分组合计功能添...(04.13)
- 【Access删除查询】删除数字最...(04.12)
- 显示文件夹中所有文件的修改时间(04.11)
- 铁路工程管理系统;铁路工程管理小程...(04.10)
- 【Access查询示例】怎么将两个...(04.09)
- 【Access窗体导出PDF】Ac...(04.08)