每个星期的一周 [英] Week of the month

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

问题描述




我有一份报告,其中列出了各个日期的工作时间。什么可以是

方式为每个条目分配

条目的日期所属的月份?


谢谢


问候

解决方案

月份定义为;

如果date1是第一个条目的日期,那么

date1 - date1 + 6 =第1周

date1 + 7 - date1 + 13 = week 2


等...


我可以看到有点棘手,因为date1可能是任何东西取决于

报告输入查询..


问候


" John" <乔** @ nospam.infovis.co.uk>在留言中写道

news:41 *********************** @ news-text.dial.pipex.com ...



我有一份报告,其中列出了各个日期的工作时间。什么可能是
分配每个条目的方式,该日期为
条目所属的月份?

谢谢




John写道:

月份定义为;

如果date1是第一个条目的日期,那么
date1 - date1 + 6 =第1周
date1 + 7 - date1 + 13 =第2周

等等on ..

我可以看到有点棘手,因为date1可以是任何取决于
报告输入查询的东西..

问候
约翰 <乔** @ nospam.infovis.co.uk>在消息中写道
新闻:41 *********************** @ news-text.dial.pipex.com ...



我有一份报告,其中列出了各个日期的工作时间。什么可能是
分配每个条目的方式,该日期为
条目所属的月份?

谢谢




这里我使用10/1/2004作为开始日期。我减去

开始/结束之间的天数,除以7得到一周,然后加1来得到一周所以

表示周数从1开始,而不是0.


''周的日期与开始日相同

? dateiff(d,#10/1/2004#,#10/1/2004#+ 7)\7 + 1

1

''周7天外出

? dateiff(d,#10/1/2004#,#10/1/2004#+ 7)\7 + 1

2


"约翰" <乔** @ nospam.infovis.co.uk>在留言中写道

news:41 *********************** @ news-text.dial.pipex.com ...



我有一份报告,其中列出了各个日期的工作时间。什么可能是
分配每个条目的方式,该日期为
条目所属的月份?

谢谢




创建一个表来保存所有不同的时间段 - 在这种情况下是几周。

用正确的周数标记每一行并加入在

的新表中查询。


Hi

I have a report which lists staff hours for various dates. What could be a
way to assign to each entry the week of the month that the date for the
entry belongs to?

Thanks

Regards

解决方案

Week of month defined as;

if date1 is date from the first entry whatever it is then
date1 - date1+6 = week 1
date1+7 - date1+13 = week 2

and so on..

Slightly tricky I can see, as date1 could be anything depending on the
report input query..

Regards

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:41***********************@news-text.dial.pipex.com...

Hi

I have a report which lists staff hours for various dates. What could be a
way to assign to each entry the week of the month that the date for the
entry belongs to?

Thanks

Regards



John wrote:

Week of month defined as;

if date1 is date from the first entry whatever it is then
date1 - date1+6 = week 1
date1+7 - date1+13 = week 2

and so on..

Slightly tricky I can see, as date1 could be anything depending on the
report input query..

Regards

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:41***********************@news-text.dial.pipex.com...

Hi

I have a report which lists staff hours for various dates. What could be a
way to assign to each entry the week of the month that the date for the
entry belongs to?

Thanks

Regards



Here I use 10/1/2004 as the start date. I subtract the days between
start/end, divide by 7 to get the week, and add 1 to get the week so
that the number of the week starts at 1, not 0.

''week where date is same as start day
? datediff("d",#10/1/2004#,#10/1/2004#+7)\7 + 1
1
''week 7 days out
? datediff("d",#10/1/2004#,#10/1/2004#+7)\7 + 1
2


"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:41***********************@news-text.dial.pipex.com...

Hi

I have a report which lists staff hours for various dates. What could be a
way to assign to each entry the week of the month that the date for the
entry belongs to?

Thanks

Regards



Create a table to hold all your distinct time periods - in this case weeks.
Label each row with the correct week number and join to the new table in
your queries.


这篇关于每个星期的一周的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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