Date Replacement Macro $W Returns Week # of Year Not Week # of the Month

ID: Q195065


The information in this article applies to:
  • Microsoft Site Server version 3.0


SYMPTOMS

When you use the $W date replacement macro, the week number of the year is returned instead of the week number of the month.


CAUSE

The $W macro included with Site Server 3.0 is designed to return the week number of the year. Site Server 3.0 Help incorrectly states that the $W macro returns the week number of the month.


RESOLUTION

To resolve this problem, apply the latest Site Server 3.0 service pack.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Site Server version 3.0. This problem has been corrected in the latest U.S. service pack for Microsoft Site Server version 3.0. For information on obtaining the service pack, query on the following word in the Microsoft Knowledge Base (without the spaces):

S E R V P A C K


MORE INFORMATION

The following date replacement routines are changed or modified:

  • $Z was added to return the week of the year based on a week start day of Monday. This was formerly the $W function.


  • $W was changed to return the week of the month based on a week start day of Sunday.


  • $2 was added to support IIS weekly log rotation by returning yymmww (ww = 01-06) of the immediately prior period.


Analysis is now compliant with Internet Information Server (IIS), but you may have problems with missed imports or multiple imports because IIS weekly logging is not truly weekly logging. For example, weekly log files are normally generated every seven days but the start of a new month results in a new log file. This results in log files containing time periods such as the following periods:


   7 days, 7 days, 7 days, x days, 7-x days, 7 days, 7 days, ... 


If you use weekly IIS logging and importing, you need to make sure that you import once a week using the $2 macro. At the end of the month you need to make sure you import using the $2 macro after the last Sunday in the month and before the first of the new month. You also need to import using the $2 macro sometime between the first day of a new month and the first Sunday of the new month. The only exception to the end of the month rules occurs when a new month starts on a Sunday.

Keywords : SS3SP2Fix
Version : WINNT:3.0
Platform :
Issue type : kbbug


Last Reviewed: March 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.