Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: loop Post Reply Post New Topic
Author Message
krockhold
Newbie
Newbie
Avatar

Joined: 05 Sep 2008
Location: United States
Online Status: Offline
Posts: 3
Quote krockhold Replybullet Topic: loop
     Posted: 05 Sep 2008 at 10:08am

I'm having trouble coming up with a loop formula to do what I need.

 
The report I'm working on is to have a group on UPC number, and then one on pallet number.  Then with in the pallet number group it needs to show the times of the difference processes it goes trough.
 
EXAMPLE:
 
                                         prod time             recv time              blast time
UPC:XXXXXXXXX
PALLET:XXXXXXXXXX   xx:xx:xx xx/xx/xx  xx:xx:xx xx/xx/xx  xx:xx:xx xx/xx/xx
 
my issue lies within the data, there is a one field that holds these time {transTime}, and there is another field that holds the status of the pallet {status}, in the detail it shows 3 records per pallet number, one with each status.  I need to figure out a loop formula for each status/time to put the time for that record into my formula field so it will all report on on group level line instead of the seperate detail lines.
 
EXAMPLE of how it looks in detail:
 
UPC: xxxxxxxxxxxx
   PALLET:XXXXXXXXXXXXXX      TRANSTIME: XX:XX:XX XX/XX/XX   STATUS:  PROD
   PALLET:XXXXXXXXXXXXXX      TRANSTIME: XX:XX:XX XX/XX/XX   STATUS:  RECV
   PALLET:XXXXXXXXXXXXXX      TRANSTIME: XX:XX:XX XX/XX/XX   STATUS:  BLAST
 
If i'm unclear ask me and I'll try to explain it differently.  Any help would be great.
 
Thanks in advance.
 
IP IP Logged
krockhold
Newbie
Newbie
Avatar

Joined: 05 Sep 2008
Location: United States
Online Status: Offline
Posts: 3
Quote krockhold Replybullet Posted: 09 Sep 2008 at 10:32am
anyone?  I'm bangin my head on my desk on this one.
 
i've also got join issues, almost brought down the server yesterday....
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 09 Sep 2008 at 12:09pm
Try something like this:
 
1. Create a variable and formula for each time that look something like this:
 
DateVar PROD_TIME;
if PreviousIsNull({table.pallet_number}) then PROD_TIME := null;
if {table.status} = 'PROD' then
  PROD_TIME := {table.transTime}
else
  PROD_TIME := PROD_TIME;
PROD_TIME
 
This will set the value to null when the pallet number changes and then set the value of the time when the appropriate status is found.
 
Suppress the pallet group header and the details and put your data in the group footer.
 
-Dell
IP IP Logged
krockhold
Newbie
Newbie
Avatar

Joined: 05 Sep 2008
Location: United States
Online Status: Offline
Posts: 3
Quote krockhold Replybullet Posted: 10 Sep 2008 at 1:05pm
SmileSmileSmileSmile
You're awesome!! I owe you a drink or something i think
 
it worked great.
 
Thanks SO much!
 
kory
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