在间隔中设置自动日期 [英] Setting Automatic Dates from a roll in Interval

查看:83
本文介绍了在间隔中设置自动日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助!帮助!帮助!


大家好,

我被困住了,需要你的帮助。


快速背景。


我正在使用Access 2010.

我有一个名为packages的表其中包含工程师必须在该月内定期服务的工作流程。


每个包裹在一年内必须执行一定数量的服务,有些是每月,其他是季度,双年度和每年。


我的表格字段。


我创建了包含字段的Packages表;

-Package ID

-

包裹名称

-服务间隔(每月,每季度,每两年一次)或每年)

- 最后服务到期日

- 当前服务到期日

-下一个服务到期日


现在,这是我一百万美元的问题。


假设我有一个起点(首次服务日期)。


现在我有了Interval,我怎样才能从模块,表达式或其他任何东西设置自动生成的所有截止日期?



这件事已经我的脑子很紧张,有人可能会我会稍微调整一下并提出解决方案,让我感觉如此倾倒...


感谢您的帮助


问候

解决方案

看一下 DateAdd Function(阅读更多)


Phil


  1. 以下代码将根据上次服务日期到期生成未来3年(截至2009年12月31日)的所有服务日期默认为7/1/2016和4个间隔值中的1个。简单地传递给间隔功能(每月,每季度,每年每年,每年或每年)和基准日期。更改函数中常量conYEARS的值以设置Term。
  2. 函数定义:

    展开 | 选择 | 换行 | 行号


< blockquote>您好ADezii,


非常感谢您精心回复,我将坐下来仔细阅读代码并在今晚进行测试。


但是通过细读代码可以解决一个问题,这是否能够在字段上显示正确的活动日期并能够隐藏其余部分?
$例如,b $ b,9月,当前服务到期日为2016年9月1日。上次服务日期为2016年8月1日,接下来将是2016年1月10日。 10月份,这些字段会相应重新排列吗?


最后一个问题我忘了早些说,


如何保存历史记录所有过去的服务日期,例如,如果现在是十月,我可能需要检查之前的3项服务是否已经运送。基本上,我希望告诉Access将每个服务日期存储为历史记录,因为我将在另一个包含更多字段的表的查询中使用此表。


对不起我问很多,亲切的帮助。


问候


Help! Help!Help!

Hi Guys,
I am stuck and need your help.

Quick Background.

I am working with Access 2010.
I have a table called "packages" which contain work streams that engineers have got to service periodically within that Month its due.

Each package has a set number of times in a year that a service must be carried out, Some are monthly, others are quarterly, Bi-annually and Annually.

My Table Fields.

I have created the Packages table with the fields;
-Package ID
-
Name of Package
-Service Interval (Monthly, Quarterly, Bi-annually or Annually)
-Last Service Due Date
-Current Service due Date
-Next Service Due Date

Now, here is my one million dollar question.

Supposing i have a starting point (First ever service date).

Now that i have the Interval, how can i set from a module, or expression or whatever, all the due dates to be generated automatically?


This thing has been straining my brain a lot, someone might just tweak it a little bit and come out with the solution which will make me feel so dump...

Thanks for your help

Regards

解决方案

Have a look at the DateAdd Function (Read more)

Phil


  1. The following Code will generate all the Service Dates for the next 3 years (up to 12/31/2019) based on a Last Service Date Due which defaults to 7/1/2016 and 1 of 4 Interval Values. Simply Pass to the Function the Interval (Monthly, Quarterly, B-annually, or Annually) and a Base Date. Change the Value of the Constant conYEARS within the Function to set the Term.
  2. Function Definition:

    Expand|Select|Wrap|Line Numbers


Hi ADezii,

Thanks so much for you elaborate reply, i am going to sit down and go through the codes and test it tonight.

One question though from perusing though the code, Will this be able to display the right active dates on the fields and be able to hide the rest as should be?
for instance, in September, the Current Service Due date will be 1/09/2016. the Last Service date will be 1/08/2016 and next will be 1/10/2016. In October, those fields will rearrange accordingly?

One last question i forgot to include earlier,

How can i keep the historical records of all the past service dates, for instance, if its October now, i may need to check whether the previous 3 services were carried. Basically, i wish to tell Access to store every service date as a historical record because i will use this table in a query with another Table with more fields.

I am sorry i am asking to much, kindly help.

Regards


这篇关于在间隔中设置自动日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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