December 7th, 2013, 05:53 AM
Classic ASP (VB) Converting date range to actual dates?
What's the best way to convert a range of dates (20131201 to 201401200) to individual dates (20131201, 20131202, 20131203) in a list?
I can mess with the format of the date and I can calculate the number of days in the range with DateDif but then things get complicated then it rolls over a month or a year. Is there an easy way of doing this or do I have to set a variable based on the number of days per month to build the list to control the roll over to the next month... and what about leap years?
Any help gratefully received
Last edited by dwair; December 7th, 2013 at 05:56 AM.
December 10th, 2013, 12:11 PM
datediff in days give you clear number of day between 2 dates, if you need last date of the month it is easy to get too first day of the following month always dateadd("m" ,1,month(now) & "/1/" & year(now)), last date of current month
dateadd("d", -1 ,dateadd("m" ,1,month(now) & "/1/" & year(now)))