Sad Der
accessd666 at yahoo.com
Thu Jan 29 07:08:08 CST 2004
Hi group, does anybody know how I can fill an array with the DATES between a startdate and an enddate? I'm using datediff to calculate the no of days. I want to use this in a loop e.g.: Dim x as Integer Dim arrDays() as Variant Dim intNumberOfDays as Integer dim strStart as String Dim strEnd as String intNumberOfDays = DateDiff("d", strStart, strEnd) ReDim arrDays(intNumberOfDays) for x = 0 to intNumberOfDays arrDays(x) = strStart + x next x I keep getting a Type Mismatch error. I also tried: arrDays(x) = CVAR(strStart + x) Any ideas? TIA. Sander Example: StartDate EndDate Return value(s) 21/01/2004 21/01/2004 21/01/2004 21/01/2004 22/01/2004 21/01/2004;22/01/2004 31/12/2003 02/01/2004 31/12/2003;01/01/2004;02/01/2004 __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/