Week of the month

J

John

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
 
K

Ken Snell [MVP]

Depends upon how you define the week of the month. How do you identify what
it is?
 
J

John

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
 
K

Ken Snell [MVP]

Assuming that you have access to date1 value in the query, a calculated
field similar to this might work (new date is the date that you want to know
in which week it is):

WeekNumberForReport: DateDiff("w",[date1],[NewDate]) + 1


--

Ken Snell
<MS ACCESS MVP>
 
M

Magdalena ¦nieg

U¿ytkownik "Ken Snell said:
Assuming that you have access to date1 value in the query, a calculated
field similar to this might work (new date is the date that you want to know
in which week it is):

WeekNumberForReport: DateDiff("w",[date1],[NewDate]) + 1


--

Ken Snell
<MS ACCESS MVP>


John said:
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
could
 
Top