Wrong week number - 1966

Hi,

(Access 2007)

I have a query with an expression in a field like:

WEEK: Format$([Table1].[Date1];'ww')

Above expression is always giving next week's week number if the day is 
Sunday. What can it be the problem. Any idea?

Best Regards. 


0
Art
3/4/2008 8:54:58 PM
access 16762 articles. 3 followers. Follow

2 Replies
1301 Views

Similar Articles

[PageSpeed] 17

Art,

No, this is not wrong. The date formats use Sunday as the first day of 
the week by default.  If you want it to use another day, you need to 
specify.  Also, drop the $.  To start the week on Monday, try it like this:

WEEK: Format([Table1].[Date1];'ww';2)

-- 
Steve Schapel, Microsoft Access MVP

Art Vandaley wrote:
> Hi,
> 
> (Access 2007)
> 
> I have a query with an expression in a field like:
> 
> WEEK: Format$([Table1].[Date1];'ww')
> 
> Above expression is always giving next week's week number if the day is 
> Sunday. What can it be the problem. Any idea?
> 
> Best Regards. 
> 
> 
0
Steve
3/4/2008 9:21:33 PM
On Mar 4, 4:54=A0pm, "Art Vandaley" <kesta...@hotmail.com> wrote:
> Hi,
>
> (Access 2007)
>
> I have a query with an expression in a field like:
>
> WEEK: Format$([Table1].[Date1];'ww')
>
> Above expression is always giving next week's week number if the day is
> Sunday. What can it be the problem. Any idea?
>
> Best Regards.

The default for dates is to use Sunday as the first day of the week.
So if its sunday, it belongs on the following week. You can specify
you First day though.

WEEK: Format$([Table1].[Date1];'ww';vbMonday) where vbMonday =3D 2. This
will turn: Sun, Mon, Tue, Wed, Thu, Fri, Sat week into a Mon, Tue,
Wed, Thu, Fri, Sat, Sun week. Hope this works.

You can also use the following function:

WEEK: DatePart('ww',[Table1].[Date1],vbMonday)

PS.: This is for Access 2003 but it should be the same on 2007.
-GL
0
Guillermo_Lopez
3/4/2008 9:26:46 PM
Reply:

Similar Artilces:

numbering #4
Is there any system of 'outline numbering' in Excel? Hope i'm not asking for too much! -- Dr. Sachin Wagh MBBS, DHA, DPH Nothing as easy as the outlining within MSWord. Typing the numbers is one way (not very appealing). Using a formula based on the values in the other cells may work--if you can pickout something that would indicate the level--not very nice, either. Dr. Sachin Wagh wrote: > > Is there any system of 'outline numbering' in Excel? Hope i'm not asking for > too much! > -- > Dr. Sachin Wagh > MBBS, DHA, DPH -- Dave Peterson ...

Number Format Problem
I am importing data from a program at work. The data come in in th format of ###@##(three numbers, a letter, and then 2 more numbers). The problem is that when a code such as 123E04 is imported, exce thinks it means 1.23E+04. This is a problem becasue the data I need i the E04 part. (I use the RIGHT(cell,3) formula to get the portion want.) Any ideas on how to get the number in the format I want? have tried changing the cell characteristics, and all kinds of stuff. Thank -- kola556 ----------------------------------------------------------------------- kola5567's Profile: http://...

random number generator
hi there i don't know if this is the right section, however I was wondering is there some vba or formulae to generate random numbers in a certain range I would be very greatful if you can help me Thanks Owen -- manclad ------------------------------------------------------------------------ manclad's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30016 View this thread: http://www.excelforum.com/showthread.php?threadid=497074 I like J.E. McGimpsey's =RandInt(). http://www.mcgimpsey.com/excel/udfs/randint.html manclad wrote: > > hi there ...

Need trailing zeroes to show for range of numbers....
The file I pulled into Excel for some reason cut off 2 trailing zeroes, no matter how I format it they will not show up. There are thousands of them and I can't see typing in each one over just to get two zeroes on the end. Does anyone know of a way to format this so they will show up? I have searched Microsoft online with no help. Not too much information, but try this (after saving your workbook!) In an empty cell enter the numner 100. Edit>Copy Select your data Edit>Paste Special, check Multiply -- Kind Regards, Niek Otten Microsoft MVP - Excel "Sueshe" &...

count the number of new lows within a range of cells
Hello, Is there a formula or method to count the number of new lows within a range of cells? For example, the following are in col A rows 5 to 14. Within this set a new low has been reached 3 times- (96,95,94). What I would like is a formula or macro that that would produce the results - 3. There are about 9000 rows of data and I am looking for "count of new lows within the preceding 10 rows" on a rolling basis. Thanks. 100 101 96 97 98 97 95 97 94 95 Version 1: Use this if the 9000 or so rows don't have blanks in them. In this version you just need to select the first cel...

Formula reads date as number
I have a formula that reads a list of dates in cells K5 through K20 an compares these dates to 1 date in cell M3. Cell M3 shows a date bu when I run the evaluate formula auditing tool on the formula, M3 date shows as a number, thus the formula fails. Any hel -- pete576 ----------------------------------------------------------------------- pete5761's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2961 View this thread: http://www.excelforum.com/showthread.php?threadid=49423 Dates are stored as number of days since 1-1-1900. So today (dec 16,2005) is stored as...

maximum number of indexes per SQL table that Access (jet) can deal with?
why is there a maximum number of indexes per SQL table that Access (jet) can deal with? is it really the count of indexes + statistics? I've seen plenty of documentation that states that typically DSS systems have twice as much index space as data space.. So I don't think that it's a case of 'over-indexing' I'm just tired of a crippled Jet front end and other people making me 'temporarily drop my indexes' so that they can link to my tables using Jet. has this bug gone away with Access 2007? Is it going away with Access 2010? ...

Font size in weekly view?
Outlook 2003 Is there a way to change the font size for appointments in the Weekly view (not Work Week view)? Thanks in advance... Bob That's the 2 column 7 day view? No. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messagin...

Dynamics Advanced Analytical Cube Library rolling 4 week measure
Has anyone had any experience createing a rolling 4 week or rolling 13 week measure? I noticed that there are quite a few measures developed in the periodicity table, but can't quite understand how to add a new one. Thanks in advance for the help. "George Schimenti" wrote: > Has anyone had any experience createing a rolling 4 week or rolling 13 week > measure? I noticed that there are quite a few measures developed in the > periodicity table, but can't quite understand how to add a new one. Thanks > in advance for the help. Whoops, my mistake. No...

Restart numbering ater a set number of rows
I have an excel spreadsheet with 4 columns. the first two columns contains numbers which will never change the third column starts off with 0 (zero) and is repeated for 255 rows then on the 256 row it needs to change to 1 (so basically increment by 1 every 255 rows) the fourth column starts at 0 (zero) and counts up to 255 but then needs to reset it self back to 0 on the 256 row. Help Please!!!!!:confused: ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ One way: I...

Converting Date to Work Week...
Hello, I'm trying to convert a colum of entry dates to work weeks. I have a helper row for month and year but I do not know if there is a quick way (or a built in formula in excel) to determine the "work week" (within a month). For example: ENTRY DATE: Month: Work Week: 8/26/05 August 4 8/19/05 August 3 etc. Is there a formula that I can drag down this list of about 1,800 rows with all different months? Thanks, PZan -- PokerZan ------------------------------------------------------------------------ PokerZan's Profile: ...

Wrong labels print
When I print more than 1 different ILC using the label wizard it prints the correct total number of labels but all of then are the field-values for the first label in the list. example 3 OF Ilc 39725 and 2 of Ilc 39730 will print 5 of Ilc 39725 I have tried different Ilcs and have the same problem If I use a Avery Label it print OK. I'm running V 1.3.1002 on XPPro w/SQLEXpress The Eltron code is below ... 'BM_HangTag [INITIALIZE] N ZB Q278,20+0 R0,0 S1 D7 [LABEL] LO506,4,56,1 LO506,237,56,1 LO506,5,3,232 LO559,5,3,232 A200,190,3,4,2,1,R,"BETH MONE" A260,230,3,3,1,1...

Adding an apostrophe to a column of numbers
Hello, I need to add an apostrophe to each cell in a long column of numbers. I do not want to format them as text or format them as custom - our system requires the apostrophe at the beginning of the cell. My question is - is there a way to format one cell with the apostrophe and then copy that apostrophe down to the other cells?? or can someone write me something that will allow me to do it quickly? I want to avoid having to go into each cell and put the apostrophe in! Thank you in advance.... One way. Change 9 to your column Sub addapostophe() mc = 9 'column I For i = ...

How do I insert a specific number in a gantt bar
Hi I,m attempting to insert a specific number into a gantt bar or edit default text in the format box. Any body help? Hi GarryB, I'm not sure I understand completely what you are trying to do. I'm guessing edit the information which shows next to the bars on the Gantt chart? Insert a custom field into the table through Insert > Column and pick on of the text columns. Enter the value you want to show. Then Format > Bar Styles. Select the bar type and on the Text tab, select the custom field. I hope this helps. Let us know how you get along. Julie Pr...

Salary USD$4 ten thousand dollars every week #2
Salary USD$4 ten thousand dollars every week Film http://www.probuilderplus.com/htdocs/powerline2.swf We Don't Leave Anything Up to Chance. Just plug into our proven 3-Step Wealth Generation System. 1. No Selling! 2. No Meetings! 3. No Pressure! FREE join than see the website http://favorjean.probuilderplus.com/ I thought it was just hype, but... ...

Mutliple Page Number sets
I'm setting up a book to go out to short run press. Using publisher because I get it through license for super cheap, so it didn't make sense to purchase an expensive publishing suite. But I want to do some things with the page numbers that I can't figure out to do. I want and intro and foreword to be in roman numerals, and then the main body of the text to have regular page numbers. What I really can't figure out though, is how to get the page numbers to start on "1" with the first page (currently starting on 11. I have Master Sheets applies to the differ...

From VBA: How to select a column by column number instead of letter? #2
I'm in MS Access and don't know from column letters - all my constants are in terms of column number. I'd like to select, say, column number 7 and hide it.... ? -- PeteCresswell Gord and I sent you a macro solution for EXCEL as this is an Excel ng. -- Don Guillett SalesAid Software donaldb@281.com "(Pete Cresswell)" <x@y.z> wrote in message news:uch701tveuot081n0q0h9rpq1r0c24v1sc@4ax.com... > I'm in MS Access and don't know from column letters - all my constants are in > terms of column number. > > I'd like to select, say, column number...

CRM should allow auto numbering of the products
---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=9c8e0ba6-f37a-4fc1-84fd-ff5b578e2c76&dg=microsoft.public.crm ...

PO next number changes randomly GP10
Hello, The company I currently work for has been seeing the next PO number being changed in the purchase order processing screen. This occurs randomly. To try to determine the cause of this, I have turned on the activity tracking as well as sql triggers on the pop40100 table. Has anyone else seen this before or have any suggestions on how to determine what is causing this to change? Any help would be greatly appreciated. Thank you, JC Hi JC when you say it is changing what do mean? I believe that the PO numbers will go back and fill in for PO's that have been deleted. I.E. i...

create a cell that accumulates, numbers from another cell...
I need to know how to have a entery cell that can send number values to a cell that accumilates there sum .the entries in the entery cell can be changed and the recieving cell just keeps adding up. The entry cell can be left blank and the sum remains in recieving cell. -- Thanks sombull http://www.mcgimpsey.com/excel/accumulator.html -- Regards, Peo Sjoblom "sombull" <sombull@discussions.microsoft.com> wrote in message news:41021B44-363C-418C-9A4F-6CD126431698@microsoft.com... > I need to know how to have a entery cell that can send number values to a > cell ...

sunday is my week ending day
Hi All, When I use DATEDIFF(week, '6/1/2010', '6/6/2010') the answer I expect should be 0 because I consider Sunday my week ending day. The answer I get is 1 which is incorrect in my situation. How would I adjust for this? Thanks, rodchar You can use SET DATEFIRST to change first day of the week and check it's current value using SELECT @@DATEFIRST. But I think algorithm if DATEDIFF does not take it into account. Instead you can count number of days and divide it by 7. "rodchar" <rodchar@discussions.microsoft.com> wrote in message ...

OWA 2003 number of emails viewable
Hello, I was wondering if anyone knew where to set the number of viewable emails in OWA? By default it does not allow very many to be displayed. Thanks, Greg It's 25 by default. In OWA, click the Options button and then check the 'Messaging Options' section. There's an option called 'Number of items to display per page'. -- Neil Hobson Exchange MVP For Exchange news, links and tips, check: http://www.msexchangeblog.com "Greg" <anonymous@discussions.microsoft.com> wrote in message news:107801c47b40$76dd3b30$a401280a@phx.gbl... > Hello, > I...

Lowest number excluding zero
I have five columns for each vendor and I am trying to determine who has the lowest price out of the seven vendors. The data is not in an array. The critical data would be in i.e. cells: T20, Z20, AF20, AL20, AQ20 and AV20. I want to calculate the lowest price excluding zero out of those cells. I experimented by putting numbers into B4, C5, D6 and E7 I used Insert | Name | Define (in XL 2003) to define MYDATA to refer to =Sheet1!$B$4,Sheet1!$C$5,Sheet1!$D$6,Sheet1!$E$7 In XL 2007 use Formulas | Define names | Define Name Then In a cell I typed =MIN(mydata) and it returned the low...

Form of phone numbers in contact list
I am using Blackberry's Desktop Software to syncronize with my MS Outlook Contacts list. The onboard caller-id function of the phone that is supposed to correlate the incoming phone number to a name of a contact (should the number be in my contacts list) isn't working. According to help from Blackberry the problem is the "form" of the numbers as they're being loaded on the Blackberry from MS Outlook. Specifically, apparently the fact that the numbers are stored in the form of (###) ###-#### instead of something like ###-###-#### is keeping the phone from realizi...

change a text format to number format
I need to link to someone elses table but they have used a different format type for a field called ACCOUNT. I am a beginner and do not know how to write SQL but I was wondering if it is possible to use an update query to change a text field in this situation into a number format. I am trying to run a mismatch query on this table with another table in my database that has a field called ACCOUNT but my table has a number format. I am trying to come up with a list of ACCOUNT numbers that are common in both tables. Thank you in advance for any direction you can provide Let...