troubleshooting Question

Function to return Date Range from week Number

Avatar of CVSmarc
CVSmarc asked on
Visual Basic Classic
4 Comments1 Solution367 ViewsLast Modified:
Hi Folks.

I need a solution to this issue. The answer can be in VB or VBScript as I will be translating it to VBScript for running in an ASP page later.

I'm getting really confused with the VB Date calculations where one gets 53 weeks in a year, and working out what is the first and last week in a year.

What I need is this..

A way to ask for the date range of the week in a month. The number of days do NOT have to equal 7.

For example  if I ask xxx routine Year=2005,   Month = 1, Week = 1, Weekstart = vbMonday

I will get  01/01/2005  - 01/02/2005  (2 days)

If I ask xxx routine Year=2005,   Month = 1, Week = 2, Weekstart = vbMonday

I will get 01/03/2005 - 01/09/2005 etc

I know I will be getting upto 6 weeks in the month but that is ok. And  when I reach 31/12/2005 that will be 12/26/2005 - 12/31/2005.

Many thanks for any prompt reply

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros