473,802 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need a function to get the date of the monday in a given (year,weeknumbe r)

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
change from country to country.
(I am looking for a dutch solution.)

Thanks, dik
Nov 13 '05 #1
3 1890
dik mus wrote:
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 change from country to country.
(I am looking for a dutch solution.)

Thanks, dik


See if you can adjust the following functions to your purpose:

http://groups-beta.google.com/group/...6bc45c1dec540f

If not then explain how the Dutch count weeks and I'll try to help.
James A. Fortune

Nov 13 '05 #2

dik mus wrote:
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 change from country to country.
(I am looking for a dutch solution.)

Thanks, dik


this is a shell of a function, but should point you in the right
direction

Function GetMondayOfWeek (byval intYear as integer, byval intWeek as
integer) as date

dim dtTemp as date

'create a date for the first of the given year
dtTemp=dateseri al(intYear,1,1)

'add the given number of weeks to it
dtTemp = dateadd("w",int Week,dtTemp)

'increment by days until you hit a Monday
do until weekday(dtTemp) =vbMonday
dtTemp=dateadd( "d",1,dtTem p)
loop

'return the date that is the Monday of the week.
GetMondayOfWeek =dttemp
end function
Check the syntax and all that - This is totally off the top of my head.

Nov 13 '05 #3
I try to get it working,
Thank you very much! Dik

"dik mus" <di*@removemusi t.nl> schreef in bericht
news:cs******** **@news2.solcon .nl...
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
change from country to country.
(I am looking for a dutch solution.)

Thanks, dik

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2766
by: James Fortune | last post by:
I'm doing some computations in order to do capacity planning. Instead of using some function from an Access book to do the weekday calculation, I decided to come up with an alternate method since a typical capacity report will look only at hours quoted for the next six months. I remembered Zeller's Congruence from a Number Theory class I took at O.U. (that extra Bachelor's Degree in Applied Mathematics was useful after all) and adapted...
18
5928
by: jimfortune | last post by:
I have an A97 module called modWorkdayFunctions in: http://www.oakland.edu/~fortune/WorkdayFunctions.zip It allows the counting of workdays taking into consideration up to 11 U.S. holidays. More holidays can be added easily. Also, there is a boolean flag for including or excluding Saturdays or Sundays as part of the work week. The only thing I know of that is missing is that some holidays are observed on a Friday or a Monday if they...
2
34353
by: Rustan | last post by:
Hi Im using GregorianCalendar to find out the current years week numbers. When the user chooses a week number in a dropdown i want to show that week in a table with the corresponding dates. For example : the user choses week43 (this week) so somehow i must calculate what date is startdate that week (monday 18th). How do i do this with c# ? all i know is that its-
1
1247
by: Guoqi Zheng | last post by:
Dear sir, We are on the week of 27 in year 2004. So this week is "2004-27", last week is "2004-26", My question is how can I get the first sunday of week "2004-26", how can I change string "2004-26" into a DateTime variable with the value of first sunday of week 2004-26??? --
1
2889
by: Martin Emanuelsson | last post by:
Hello, Knowing year and weeknumber of this year, I'm looking for some way to get the date of the first and last day of that particular week. Does anyone have an idea about how to do this? Best regards Martin
1
1142
by: Vanessa | last post by:
Does anyone know whether when I select a weeknumber of a certain year, eg. 2004, the date from first day to the last day of the week will be known. Regards Vanessa
2
4072
by: Agnes | last post by:
Does .net provide any function for such purpose ? e.g today is 21-10-2004, the week is 43, now I want to get the DATE with (week 42, Monday) Thanks alot
9
2421
by: mistral | last post by:
Need help to remove list of days from date script. Need format "June 07, 2006" <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // Get today's current date. var now = new Date();
2
3158
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button then the calender gone actually i want if i click outside off the calender then it should me removed ..How kan i do this ... Pls inform me as early as possible .. I am waiting for ur quick replay ...Here i attached the source code .... <!DOCTYPE...
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.