将一周添加到日期作为默认值 [英] Adding one week to a date as a Default
问题描述
我想在Access表中添加一周的日期以获取默认设置。我尝试在截止日期的常规属性默认字段中使用DateAdd函数,如下所示:
DateAdd(" ww",1,[Date Received])
我希望得到一个结果我的表单会自动为"收到日期"字段输入任意日期值一周。收到日期字段设置为今天日期的默认值。
任何人都可以看到我做错了或者这甚至不可能吗? / p>
我不希望有一个计算字段,只有一个可以更改的默认值。
提前感谢您的帮助/建议
Hi Wendy,
只要需要显示新记录,就会计算显示值的默认值。因此,对于新记录,如果您在[收到日期]中没有显示任何内容,则截止日期无需计算。现在,如果您的[收到日期]字段
的默认值为Date(),那么您也可以将其用作[截止日期]中的默认值。例如,您可以尝试:
DateAdd(" d",7,Date())
希望有帮助...
I would like to add one week to a date in my Access table for the default setting. I tried using the DateAdd function in the General properties default field for Due Date like this :
DateAdd("ww",1,[Date Received])
I was hoping to get a result on my form that would automatically add one week to whatever date value is entered for the Date Received field. The Date Received field is set to a default of today's date.
Can anyone see what I did wrong or is this not even possible?
I don't want to have a calculated field, only a default value that can be changed.
Thank you in advance for your help/suggestions
Hi Wendy,
Default Values are calculated for display as soon as a new record needs to be displayed. So, for a new record, if you don't have anything showing in [Date Received], then there is nothing for the Due Date to calculate. Now, if your [Date Received] field has a Default Value of Date(), then you can also use it for the Default Value in [Due Date]. For example, you could try:
DateAdd("d", 7, Date())
Hope it helps...
这篇关于将一周添加到日期作为默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!