DateSerial函数未返回月末的正确日期 [英] DateSerial Function not returning correct date for end of month

查看:102
本文介绍了DateSerial函数未返回月末的正确日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

案例 1390861292

  https://support.microsoft.com/en-us/help/210604/functions-for-计算和显示日期时间值访问

 https://support.microsoft.com/en-us/help/210604/functions-for-calculating-and-for-displaying-date-time-values-in-acces

在表单的文本字段中使用Access 2016和以下公式,以返回结尾处的日期月份:

Using Access 2016 and the following formula in a text field on a form to return the date at the end of the month:

DateSerial(年(日期()),月(日期())+ 1,0)

DateSerial(Year(Date()), Month(Date()) + 1, 0)

我将于7月30日到达,2017年7月份有31天。

I am getting July 30, 2017 but there are 31 days in July.

Sarah C. on"Live Chat"建议我去专业支持,但这似乎是按使用付费服务。 我需要支持您的计划中出现的错误。 请帮忙。

Sarah C. on "Live Chat" suggested I go to Pro Support, but that appears to be a pay per use service.  I need support for what appears to be a bug in your program.  Please help.

推荐答案

我也尝试过: 

I have also tried: 

DateAdd(" m",1,DateSerial(Year([MyDate]),Month([MyDate]),1)) - 1

DateAdd("m",1,DateSerial(Year([MyDate]),Month([MyDate]),1))-1

来自这篇文章:

// social.msdn.microsoft.com/Forums/en-US/bfaccea9-e6e9-48f1-ade5-d99d0bc75995/creating-end-of-month -dates?forum = accessdev

//social.msdn.microsoft.com/Forums/en-US/bfaccea9-e6e9-48f1-ade5-d99d0bc75995/creating-end-of-month-dates?forum=accessdev

我仍然在2017年7月30日而不是2017年7月31日

and I am still getting July 30, 2017 and NOT July 31, 2017


这篇关于DateSerial函数未返回月末的正确日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆