Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Week number wrong

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nikki17 - 10 Nov 2005 12:06 GMT
I am extracting some information from my database in week format.
I have done this in the normal way of using the Format function and W.
The week number it gives me is one ahead of actual week number in my diary.
Has anyone else come across this, or know how to fix it??
Emma Hope - 10 Nov 2005 12:56 GMT
Simply speaking you could write your formulae and put -1 at the end, i.e.
minus 1 from each week number to give the correct value.

> I am extracting some information from my database in week format.
> I have done this in the normal way of using the Format function and W.
> The week number it gives me is one ahead of actual week number in my diary.
> Has anyone else come across this, or know how to fix it??
Jeff Boyce - 10 Nov 2005 13:03 GMT
Perhaps your Windows settings specify a different start day for the year
than you are using?

Signature

Regards

Jeff Boyce
<Office/Access MVP>

> I am extracting some information from my database in week format.
> I have done this in the normal way of using the Format function and W.
> The week number it gives me is one ahead of actual week number in my diary.
> Has anyone else come across this, or know how to fix it??
John Spencer - 10 Nov 2005 13:21 GMT
The week number is dependent on two factors - what is the first day of the
week and how is the first week defined.  Take a look at the help on the
format function.  You may need to use

Format("ww",SomeDate,2,3)

That says return the week number for some date where the week starts on
Monday and week number 1 of the year is the first week with seven days.  If
you didn't set those arguments, then  your week number is based on Sunday
and week number 1 is the week that contains January 1.

>I am extracting some information from my database in week format.
> I have done this in the normal way of using the Format function and W.
> The week number it gives me is one ahead of actual week number in my
> diary.
> Has anyone else come across this, or know how to fix it??
Nikki17 - 11 Nov 2005 09:31 GMT
Thanks John that works.  I don't understand what the 3 does though. I am
assuming the 2 is to start the day on Monday?  Could you confirm what the 2,
and 3 relate to?

> The week number is dependent on two factors - what is the first day of the
> week and how is the first week defined.  Take a look at the help on the
[quoted text clipped - 12 lines]
> > diary.
> > Has anyone else come across this, or know how to fix it??
John Spencer - 11 Nov 2005 12:48 GMT
The 2 argument is Monday
The 3 argument is Week 1 of the year has seven days in the year.

For an explanation, look them up in VBA help.
-- Open up your application
-- Type Control G
-- Press the F1 key
--Click the Index tab
--Type Format Function in the Keywords entry
--Click on Search
--Click on Format Function in the Choose a Topic list

OR
-- Open up your application
-- Type Control G
-- Press the F1 key
-- Click on the Contents tab
-- Select Visual Basic Language Reference: Functions:D-G: Format Function

> Thanks John that works.  I don't understand what the 3 does though. I am
> assuming the 2 is to start the day on Monday?  Could you confirm what the
[quoted text clipped - 19 lines]
>> > diary.
>> > Has anyone else come across this, or know how to fix it??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.