Week# of Month
Posted on 1997-09-26
We writing some queries for reporting. We needs
to know the week # of the month the day falls on (eg. Sept. 21, 1997
should fall on week #4).
We used something like:
However, this is not working as we had expected it would. For example,
in September 1997, week #1 should be from the 1-6, #2 from 7-13, #3 from
14-20, #4 from 21-27, and #5 from 28-30. However, the "W" date
conversion seems to consider a week to start, on the very day the
month starts (eg. for September, the 1st falls on a Monday, therefore
the week spans returned by the "W" conversion incorrectly reports the
week #'s as (in the case of September), #1: 1-7, #2: 8-14, #3: 15-21,
#4: 22-28, #5: 29-30.
Any help would be greatly appreciated.
Thanks in advance.