Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Finding First Instance Post Reply Post New Topic
Author Message
AngryLarry
Newbie
Newbie
Avatar

Joined: 13 Dec 2012
Location: United States
Online Status: Offline
Posts: 4
Quote AngryLarry Replybullet Topic: Finding First Instance
    Posted: 13 Dec 2012 at 8:32am
My first post here, love the forums.  I have tried to search the answer to my problem but I am having a hard time coming up with the right keywords to get to the results I am looking for.  Here is my dilemma:

I have a calendar view (grid) attendance report that fills in the attendance codes, by date, and other assorted info for all the children at the end of the school year.  We have a spot for "First Day" on this report that we need to track for billing and other reporting purposes mostly.

I need to come up with a formula that says if the "Attendance code" field in the "Attendance" table = "X" then display the "attendance date" field in the "Attendance" table (and stop!).  Else move to the next school day. (9/10/12-6/28/13).  And I guess as an exit, else if "X" does not exist Print Line "N/A".

X is our code for "Child Present" within the attendance code field of the attendance table.

I tried to search examples of WHILE DO loops and such but I cannot find anything that is close to what I am looking for, or I would have copied and disassembled it Wink

Any suggestions?

I am using Crystal Reports XI
Thanks!
Larry
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 13 Dec 2012 at 8:57am
If you are grouping by student, it shouldnt be too hard. You can use a running total.

In the Summarize
{Date of Attendance}
Type of Summary - min

Evaluate
formula - {Attendance Code} = 'X'

Reset on change of group
IP IP Logged
AngryLarry
Newbie
Newbie
Avatar

Joined: 13 Dec 2012
Location: United States
Online Status: Offline
Posts: 4
Quote AngryLarry Replybullet Posted: 13 Dec 2012 at 9:12am
Thank you Comatt1!

This is the best thing to happen to me today.  I created the running total but got the answer of 11/15/12 for everything.  Then I realized that was the day we switched from entering no code for student present to using an "X".  I did a batch update to change all the blank codes to X's and all the dates are now printing as expected!

Thanks again for your time and your help!
Thanks!
Larry
IP IP Logged
AngryLarry
Newbie
Newbie
Avatar

Joined: 13 Dec 2012
Location: United States
Online Status: Offline
Posts: 4
Quote AngryLarry Replybullet Posted: 14 Dec 2012 at 1:39am
It appears I am encountering one issue with this running total.  We have other codes besides X.  Only X means present.  There are codes like 3, 4, 6 etc. which means child not in the school for a variety of reasons.

When I run an attendance form for a child who was marked as being absent his first scheduled session, that date was picked up.

For state and compliance reasons we need to document the day of the child's first session differently than their enrollment date.

What could I add to the formula to make it only look for X codes.  It would seem like attendance.code = X should of done the trick like you suggested.
Thanks!
Larry
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 14 Dec 2012 at 2:38am
the attendance.code = X should have done the trick. The only explanation I can think of is a data issue. The RT will not pick up those 3,4,6 values unless explicitly told to.

Look at the data for those dates, there must be an X somewhere
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.