Compute the Week Number in the Month for a Date

Author: Tripp W Black

Created: 10/17/2000 at 04:37 PM

 

Category:
Notes Developer Tips
Forms/Subforms, Formulas

From the Advisor via SearchDomino Email

By Nagendra Rentala
Perth Amboy, NJ, 08861 - 3666


Some applications require the computation of the week number in a month in which a given date falls. For example, Sunday 02 May 1999 is in the second week while Saturday 01 May 1999 is in the first week.


This formula computes the week number of date value GivenDate:


WeekNumber := @Integer( (@Day(GivenDate) - @WeekDay(GivenDate)+13) /7 )


previous page