Hello!
I´m trying to get the weeknumber fom a given date but at some dates
will return the wrong weeknumber.
WeekNumber = DatePart("ww", TodayAsDate, vbMonday, vbFirstFourDays)
like 2003-12-27
I know that this is a Microsoft bug but i have tried their soultion http://support.microsoft.com:80/supp.../q200/2/99.asp
but still it will return strange weeknumbers at some dates.
I want the output in weeks from 1 - 52 and every week starts with a
Monday.
Does anyone have a good function to output the weeknumbers from
a given date?
Micke 2 4930
You cannot avoid having some dates return 53 as the week number. Think about
it. Using your definition, any year where 1-Jan is a Monday will have 53
weeks . What week number should 12/31/2001 return?
Try this script so you see the problem:
<%
dim d, i
d=#1/1/2001#
do until weekday(d) = vbMonday
d=dateadd("d",1,d)
loop
i=1
do until d > #1/1/2002#
Response.Write d & ": " & i & "<BR>"
d=dateadd("ww",1,d)
i = i + 1
loop
%>
Bob Barrows
MONO wrote: Hello!
I´m trying to get the weeknumber fom a given date but at some dates will return the wrong weeknumber.
WeekNumber = DatePart("ww", TodayAsDate, vbMonday, vbFirstFourDays)
like 2003-12-27
I know that this is a Microsoft bug but i have tried their soultion http://support.microsoft.com:80/supp.../q200/2/99.asp
but still it will return strange weeknumbers at some dates.
I want the output in weeks from 1 - 52 and every week starts with a Monday.
Does anyone have a good function to output the weeknumbers from a given date?
Micke
Ohoooo, I´ve got major meltdown in my brain. I don´t know what i was
thinking about. Everthing is working fine.
Thanks for helping me think :-)
/mike
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message news:<uI*************@tk2msftngp13.phx.gbl>... You cannot avoid having some dates return 53 as the week number. Think about it. Using your definition, any year where 1-Jan is a Monday will have 53 weeks . What week number should 12/31/2001 return?
Try this script so you see the problem: <% dim d, i d=#1/1/2001# do until weekday(d) = vbMonday d=dateadd("d",1,d) loop i=1 do until d > #1/1/2002# Response.Write d & ": " & i & "<BR>" d=dateadd("ww",1,d) i = i + 1 loop %>
Bob Barrows
MONO wrote: Hello!
I´m trying to get the weeknumber fom a given date but at some dates will return the wrong weeknumber.
WeekNumber = DatePart("ww", TodayAsDate, vbMonday, vbFirstFourDays)
like 2003-12-27
I know that this is a Microsoft bug but i have tried their soultion http://support.microsoft.com:80/supp.../q200/2/99.asp
but still it will return strange weeknumbers at some dates.
I want the output in weeks from 1 - 52 and every week starts with a Monday.
Does anyone have a good function to output the weeknumbers from a given date?
Micke This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Graeme Longman |
last post by:
Hi everyone,
I was wondering if anyone has written some Python code which uses a start
date and end date and a given interval (day, month or year) and outputs all
the time periods for that range...
|
by: dlx_son |
last post by:
Here is the code so far
<form name="thisform">
<h3>Enter time to add to or subtract from:</h3>
(If not entered, current time will be used)<br>
Day: <input name="d1" alt="Day of month"...
|
by: AdityaK |
last post by:
Is there anyway I can get weekend date for a given date using DB2
query? I couldn't find any DB2 function that can be used to do so.
Thanks,
Aditya
|
by: AdityaK |
last post by:
Is there a way to find Weekend date for a given date using a DB2
query? I see that there are scalar functions such as DAY, DAYOFMONTH,
DAYOFWEEK,etc are available...but couldn't find one to get a...
|
by: dik mus |
last post by:
Hi,
I connect to a database that only stores the year and weeknumber. But i need
the date of the corresponding monday.
This could be more difficult as one expect because the weekumbers might...
|
by: Lee Harr |
last post by:
I wrote a function to return the first date of a given week
(and a few related functions) :
-- return the first date in the given week
CREATE or REPLACE FUNCTION week_start(integer, integer)...
|
by: Tim Chase |
last post by:
I've been trying to come up with a good algorithm for determining
the starting and ending dates given the week number (as defined
by the strftime("%W") function).
My preference would be for a...
|
by: perryclisbee via AccessMonster.com |
last post by:
I have dates of service for several people that range all over each month.
ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I
need to create a new field via a query that...
|
by: Martin |
last post by:
I'm retrieving some records from a database. One of the fields
contains a date/time. I would like to format it as I send it out to
the table in the displayed page.
Can some one please tell me...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |