Weeknumber today is 01 instead of 53

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
 
B

Bob

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???
 
G

Guest

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.
 
B

Bob

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.
 
V

Van T. Dinh

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.
 
B

Bruce M. Thompson

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.
 
B

Bob

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
 
A

Arvin Meyer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top