473,387 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,387 developers and data experts.

Function to Move (Forwards or Backwards) Through Weekdays

NeoPa
32,556 Expert Mod 16PB
This code is quite old and may be bettered.
If anyone feels they can produce better code for this function go ahead and PM me your effort. If I feel that it is better (More efficient & 100% accurate) then I will replace this with it.
Until then, it is at least a usable version that visitors can use when they're in need.

Expand|Select|Wrap|Line Numbers
  1. 'MoveWD moves datThis on by the intInc weekdays.
  2. Public Function MoveWD(datThis As Date, intInc As Integer) As Date
  3.     MoveWD = datThis
  4.     For intInc = intInc To Sgn(intInc) Step -Sgn(intInc)
  5.         MoveWD = MoveWD + Sgn(intInc)
  6.         Do While (Weekday(MoveWD) Mod 7) < 2
  7.             MoveWD = MoveWD + Sgn(intInc)
  8.         Loop
  9.     Next intInc
  10. End Function
Jan 21 '07 #1
0 6992

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tiernan | last post by:
Hi all I'm looking for a way to find the number of weekdays between 2 dates In my form I have three fields for a begin date (dd)(mm)(yyyy) and three for the end date (dd)(mm)(yyyy) Now these...
10
by: JJA | last post by:
I'm trying to use document.getElementByID inside a function where the ID is passed as an argument. I get the same error ("Element has no properties") on the same statement inside the commonCheck...
26
by: MLH | last post by:
How would I modify the following to achieve a 2-dimensional array? Dim MyWeek, MyDay MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") ' Return values assume lower bound set to 1...
5
by: Daniel Rudy | last post by:
Hello Group, I've looked at this backwards and forwards and I can't seem to find the problem here. What happens is I have a multidimensional array of char that has 3 dimensions with a...
4
by: MLH | last post by:
I'm thinking of an integer field in which I could write values up to 1+2+4+8+16+32+64 and to use these values later. Each of the individual values would represent a weekday from Sunday to Saturday....
1
by: anupamaavadutha | last post by:
hi all, iam new to javascript. i have problem calling javascript functions.iam designing a calender page.here is my code. <%@ page...
1
by: Orestis Markou | last post by:
Hello, I'm the developer of PySmell ( http://github.com/orestis/pysmell ), a static analysis/intellisense provider for Python. I am targeting Python 2.4 code so I'm using the compiler package. ...
0
by: Terry Reedy | last post by:
Orestis Markou wrote: My impression is that the 2.6 ast package is quite different from the 2.4 compiler package, but I have not looked at it (in its 3.0 version) yet. If the 2.4 code you are...
18
by: MyWaterloo | last post by:
I quickly put this code together to test if it would disable some of my functions OnChange when my text box (purchase order number) is empty...and if it would enable those functions when I added data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
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...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.