472,353 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Week of the month

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
Nov 13 '05 #1
3 5041
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

Nov 13 '05 #2
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

Nov 13 '05 #3
"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.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this...
13
by: SimonC | last post by:
I would like to return data from the last 2 weeks of each given month in Javascript, but in 2 formats. So, the penultimate week (Monday to...
10
by: Ty Smith via AccessMonster.com | last post by:
I noticed that the week numbers in Stephan Leban's MonthCalendar are not consistent with Microsoft Outlook (they are shifted one week forward). Is...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These...
6
by: aarklon | last post by:
Hi folks, I found an algorithm for calculating the day of the week here:- http://www.faqs.org/faqs/calendars/faq/part1/index.html in the...
2
by: TGEAR | last post by:
I would like to increase by one week and if it reaches 5th week, month will be increased by one and also it will show a different text when it...
10
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need...
9
by: AideenWolf | last post by:
Windows XP - Access 2003 I've been researching this for about 3 weeks now and I'm no closer then when I started so any help you all give me will...
2
by: tasmontique | last post by:
I am working on an access 2002 flight schedule database. I am new to access but have some basic understanding of sql and vb6 code. I have learned...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, is there a way if you are given a Year and a Week an easy way to go back say 26 weeks ago from given year/week. for example, given:...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.