Click here to Skip to main content
15,886,551 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have one start date and one end date  , i want to generate the dates from these two given dates using vb scripting . For Example Start Date = 11/8/2020, End Date = 11/11/2020 Output = 11/8/2020 , 11/9/2020 , 11/10/2020 , 11/11/2020


What I have tried:

I have one start date and one end date  , i want to generate the dates from these two given dates using vb scripting . For Example Start Date = 11/8/2020, End Date = 11/11/2020 Output = 11/8/2020 , 11/9/2020 , 11/10/2020 , 11/11/2020
Posted
Updated 8-Nov-21 1:12am

1 solution

Try:
VB
Dim start As DateTime = DateTime.Parse("11/08/2020")
Dim [end] As DateTime = DateTime.Parse("11/11/2020")
Dim between As List(Of DateTime) = New List(Of DateTime)()

While start <= [end]
    between.Add(start)
    start = start.AddDays(1)
End While
 
Share this answer
 
Comments
Richard Deeming 9-Nov-21 5:43am    
I suspect the OP's "vb scripting" means VBScript, not VB.NET. :)
OriginalGriff 9-Nov-21 5:49am    
:D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900