Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need an Array master to help plz...URGENT Post Reply Post New Topic
Author Message
asadiq
Newbie
Newbie


Joined: 16 Nov 2009
Online Status: Offline
Posts: 16
Quote asadiq Replybullet Topic: Need an Array master to help plz...URGENT
     Posted: 18 Nov 2009 at 6:35am
Hi,
 
I am trying to print all dates between a {Table.Start Date} and {Table.End Date}
 
This is the code i am using.
 
local NumberVar bkglth := DateDiff('d',{Table.Start Date},{Table.End Date});
local NumberVar i := 0;
shared datetimevar array aDate;
 
Redim aDate[bkglth];
For  i:= 0 to bkglth do
(
aDate:= dateadd("m",i,{Table.Start Date});
);
 
The error I am getting is "An array's dimension must be an integer between 1 and 1000"
 
 
Any ideas?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Nov 2009 at 5:09pm
Can either of your fields be null?  If it can, you need to modify your code to something like this (I haven't tested it...)
 
local NumberVar bkglth;
local NumberVar i := 0;
shared datetimevar array aDate;
 
if not IsNull({Table.StartDate}) and not IsNull({table.EndDate}) then
bkglth := := DateDiff('d',{Table.Start Date},{Table.End Date});
Redim aDate[bkglth];
For  i:= 0 to bkglth do
(
aDate:= dateadd("m",i,{Table.Start Date});
);
else <figure out what to do if the dates are null....>
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum