[AccessD] Store all days between 2 dates / Type Mismatch

Erwin Craps - IT Helps Erwin.Craps at ithelps.be
Thu Jan 29 07:24:46 CST 2004


Just at first sight

strStart
strEnd 
Should be date type and  not string
An I supose arrDays() to.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Sad Der
Sent: Thursday, January 29, 2004 2:08 PM
To: Acces User Group
Subject: [AccessD] Store all days between 2 dates / Type Mismatch

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/
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list