Weeknumber today is 01 instead of 53

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi there,

i many forms i use the following function to get the weeknumber:

DatePart("ww";Now();1;1)

why does it say's that the weeknumber is 53???

i all calendars is it week 01 from 2004

Greetings,

Bob
Holland
 
Yes it is the first week of 2004, but access say's it is week 53.
How can i tell access that it is today weeknumber 01???
 
I am no expert on this, but I think this might be due to haveing grouped and sorted your report by week. I think if you change the grouping and sorting you might get a different result.
 
No it's not a grouping problem, i try to explain the problem:

I'am using the following expression as a default in a numeric field:

IIf(DatePart("ww";Now();1;1)<11;CLng(DatePart("yyyy";Now();1;1) & "0" &
DatePart("ww";Now();1;1));CLng(DatePart("yyyy";Now();1;1) &
DatePart("ww";Now();1;1)))

With this expression i save the actualy year&weeknumber in a numeric field
in the following format: "200350", "200351" , "200352" etc.
Today it say's "200353", but it should be "200401"

I'am using this format for registering working hours in a "weekcard" for
projects.

Thanks so far,

Grtzzz,

Bob Folkers
Holland




Pedro said:
I am no expert on this, but I think this might be due to haveing grouped
and sorted your report by week. I think if you change the grouping and
sorting you might get a different result.
 
I think logically, Access works out the week no. *with respect to* the year
of the date input into the function so in effect, Access says that it is
week no. 53 of the year 2003 (which is the year of the input value).

In a way (I *think*), week 53 of a given year coincides with week 1 of the
following year!

You can modify (using the MOD 52 to shows that its is week 1.
 
i many forms i use the following function to get the weeknumber:
DatePart("ww";Now();1;1)

why does it say's that the weeknumber is 53???

i all calendars is it week 01 from 2004

There are not exactly 52 weeks in a year. December 27, 2003 was the last day in
week 52 and the remaining fractional week is the 53rd week. The first of January
will fall within the fractional first week of 2004.
 
Thanks for the respons everybody,

for this fractional week i will use the overwriting manual input by hand to
get my "200401" format.
the database is on a server, thats why fooling the pc-clock is no option,
but that should be the solution if i was the only user.

Grtzz,

Bob
 
Only the data should be on the server. It should be split from the
application which should reside on and be run from the workstations. If you
are running the entire application from the server, you are asking for an
eventual corruption which may be unrecoverable.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top