构建预计日期 [英] Construct Projected Date

查看:101
本文介绍了构建预计日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想做的是有一些VB代码将变量设置到下一个纳税年但是在构建它时遇到了麻烦..


Taxdate = 01/04 / year + 1


因此,如果今年是2008年,那么我希望taxt年份返回01周一的第一个星期一/ 04/2009

考虑到如果今天是新年之后下一个税收将是相同的...任何想法???


谢谢为兴趣

Hello to all,

what i would like to do is have a bit of VB code to set a variable to the next tax year but am having trouble constructing it..

Taxdate = 01/04/year+1

so if this year 2008 then i want the taxt year to return the first monday around 01/04/2009
taking into account that if today was after new year the next taxdate would be the same... any ideas???

thanks for the interest

推荐答案


大家好,


我是什么我想做的是有一些VB代码来设置一个变量到下一个纳税年但是我在构建它时遇到了麻烦..


Taxdate = 01/04 / year + 1


所以,如果今年是2008年那么我希望taxt年回归2009年4月1日的第一个星期一

考虑到如果今天是在新的之后一年下一个税收将是相同的...任何想法???


感谢您的兴趣
Hello to all,

what i would like to do is have a bit of VB code to set a variable to the next tax year but am having trouble constructing it..

Taxdate = 01/04/year+1

so if this year 2008 then i want the taxt year to return the first monday around 01/04/2009
taking into account that if today was after new year the next taxdate would be the same... any ideas???

thanks for the interest



在Access帮助页面中查找 DateAdd 功能。它有三个参数:您正在使用的时间间隔(例如,天,月等),您要添加的间隔数以及要添加的日期。


例如,要在2008年5月14日之前添加25天,您可以写 DateAdd(d,25,2008年5月14日)。对你而言,唯一的转折是必须根据当前日期计算间隔的数量,你可以使用 DateDiff 来...


Pat

Look in the Access help pages for the DateAdd function. It has three arguments: the time interval you are working with (e.g. days, months, etc.), how many of those intervals you want to add, and the date you want to add to.

For instance, to add 25 days to May 14th, 2008, you could write DateAdd("d", 25, "14-May-2008"). For you, the only twist is that the number of intervals would have to be calculated depending on what the current date is, which you could probably use DateDiff for...

Pat


不幸的是,我无法绕过我的头......


i必须计算出之前的日期我可以找出差异来计算日期,没有意义可以做这样的事情



如果月份(日期)在04到12之间那么x = 1其他x = 0

taxdate = day(01)+ month(04)+ year(x)
Its unfortunately the twist that i cant wrap my head around...

i would have to work out the date before i could work out the difference to work out the date, doesnt make sense does it is it possible to do something like this


if month(date) between 04 and12 then x = 1 else x = 0
taxdate = day(01)+month(04)+year(x)



不幸的是,我无法扭转局面......


i必须计算出日期才算出差异来计算日期,没有意义,是否有可能做这样的事情


如果月份(日期)在04到12之间,那么x = 1,否则x = 0

taxdate = day(01)+ month(04)+ year(x)
Its unfortunately the twist that i cant wrap my head around...

i would have to work out the date before i could work out the difference to work out the date, doesnt make sense does it is it possible to do something like this


if month(date) between 04 and12 then x = 1 else x = 0
taxdate = day(01)+month(04)+year(x)



好​​的,试试这个:

OK, try this:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


这篇关于构建预计日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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