datetime - Bi-weekly date 2011 VB6 -


I'm trying to loop to achieve the 2011 bi-weekly dates using this code in VB6:

  as dim Harddet as Date dim number Oops and DVDs as a given date in the next day as dim integer as integer dim day as integer dim Rupankul X = 1 date as integer x = date hard Magistrate = Format (Now, "M / d / yay") while X & lt; & Gt; 20 NumberOfDaysSince = DateDiff ( "d", HardDate, DateToday) modulus = NumberOfDaysSince Mod 14 DaysToNext = 15 - Modulus nextpayday = Date + DaysToNext Debug.Print nextpayday HardDate = DATEADD ( "D", 1, nextpayday) DateToday = DATEADD ( "d "10, Harddit) x = x + 1 loop   

However, using the code, there is no production of bi-weekly on ...

Any help will be great!

Date Example

  Payment Start Date | Payment end date. Check date | Mail ------------------------------------------------- ------------------ 1/14/2011 | 1/24/2011 | 2/10/2011 | 2/3/2011 1/28/2011 | 2/10/2011 | 2/24/2011 | 2/17/2011 2/11/2011 | 2/24/2011 | 3/10/2011 | 3/3/2011   

David

Assuming that In 2011 you want the first date, and you know that you want 26 lucky, the code can be very simple. For example, add a text box "Text 1" to a form and set MultiLine = True in the Designer. We will use the 07/01/2011 for its early date:

  dim HardDate as integer as date dim x x = 1 HardDate = "2011/01/07" Text1 .Text = HardDate Do X = up to 26 HardDetate = Add Date ("D", 14, HardDet) Text 1.Text = Text1.Text & amp; VbCrLf & amp; HardDate x = x + 1 loop   

The output shown in the textbox looks like this:

  1/7/2011 1/21/2011 2 / 4/2011 2/18/2011 3/4/2011 ... 12/23/2011    

Comments