Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Run-Time Calendar Table Post Reply Post New Topic
Author Message
mrstacy
Newbie
Newbie
Avatar

Joined: 04 Oct 2012
Online Status: Offline
Posts: 9
Quote mrstacy Replybullet Topic: Run-Time Calendar Table
     Posted: 06 Mar 2014 at 11:50am
I work in a hospital and I'd like to make a report to take a census for each day given a data range and return the average.

I was thinking if I created a calendar and used that as the table to go against the admission and discharge history table, I could do it.

The problem is, how to make the calendar. I know I need an array, but I haven't made one before. Does this code look correct?

Local numberVar I;
Shared DateVar array opmerking;
Shared NumVar Counter
reDim opmerking{Counter};
Counter := DateDiff("d", {?BeginDate}, {?EndDate}) + 1
for I := 1 to Counter
            opmerking <i>:= {?Beginning_Date} + 1 ;
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Mar 2014 at 4:16am
can you make a table in the database...that would be the 'simplest' then you could just link you data to that table.

I think that your code would work, but it is probably too late in CR process.

I am not sure how you would go about it, but if you could do it in a command object, it would probably better serve your purposes as then you could link to it.

IP IP Logged
mrstacy
Newbie
Newbie
Avatar

Joined: 04 Oct 2012
Online Status: Offline
Posts: 9
Quote mrstacy Replybullet Posted: 07 Mar 2014 at 6:10am
Yes. command object was the idea.
IP IP Logged
hello
Groupie
Groupie
Avatar

Joined: 05 Feb 2014
Online Status: Offline
Posts: 85
Quote hello Replybullet Posted: 07 Mar 2014 at 8:14am
I did something similar to this and used the DateSerial function. DateSerial moves forward or backward within the calendar.

Just an idea.
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