Re: Simple Date Issue

  • 10 years ago

    Thanks for the help rob, that worked great. I had actually forgot all about DateDiff, although I have used it in the past.

    For anyone else who is having this problem, I created the following function

     

    Public Function CalculateDates(ByVal Date1 As Date, ByVal Date2 As Date) Dim MyDateLst As New List(Of Date) Date1 = "27/11/2006" date2 = "01/12/2006" MyDateLst.Add(date1) While DateDiff(DateInterval.Day, date1, date2) > 1 date1 = DateAdd(DateInterval.Day, 1, date1) MyDateLst.Add(Date1) End While MyDateLst.Add(date2) Return MyDateLst End Function

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”