turtlepatch
Programmer
I am working in Crystal 9.2 with an ODBC database. I have data that displays Job-id's, Location-id's, and Date of location change. Each job will have several location id's and I am trying to count the number of jobs in each location at the time of the prompted date. For example:
job-id location-id date
1 26 05/01/2006
1 28 05/04/2006
2 28 05/01/2006
2 90 05/02/2006
2 90 05/04/2006
3 28 05/04/2006
The following is an example of a Running Total that I have that is counting the number of jobs in the Preflight location (28). If a job is in the On Hold location (90) I want to be able to count the location that precedes it.
----------------------------------------------
#Preflight
{Job.Job-ID}<>next({Job.Job-ID}) and
{JobLocationChange.Locate-ID}="28" or
{Job.Job-ID}<>next({Job.Job-ID}) and
{JobLocationChange.Locate-ID}="90" and
{Job.Job-ID}=previous({Job.Job-ID}) and
previous({JobLocationChange.Locate-ID})="28"
----------------------------------------------
So if you follow the example above I should have:
#Preflight = 3
I am having two problems: It isn’t counting JobID 3 when it is the last job in the list and when I have two occurances of On Hold in a row. It can’t do a previous(previous(LocateID)).
I'm not sure how to fix these two problems. Any help is greatly appreciated.
Thanks
turtle_patch
job-id location-id date
1 26 05/01/2006
1 28 05/04/2006
2 28 05/01/2006
2 90 05/02/2006
2 90 05/04/2006
3 28 05/04/2006
The following is an example of a Running Total that I have that is counting the number of jobs in the Preflight location (28). If a job is in the On Hold location (90) I want to be able to count the location that precedes it.
----------------------------------------------
#Preflight
{Job.Job-ID}<>next({Job.Job-ID}) and
{JobLocationChange.Locate-ID}="28" or
{Job.Job-ID}<>next({Job.Job-ID}) and
{JobLocationChange.Locate-ID}="90" and
{Job.Job-ID}=previous({Job.Job-ID}) and
previous({JobLocationChange.Locate-ID})="28"
----------------------------------------------
So if you follow the example above I should have:
#Preflight = 3
I am having two problems: It isn’t counting JobID 3 when it is the last job in the list and when I have two occurances of On Hold in a row. It can’t do a previous(previous(LocateID)).
I'm not sure how to fix these two problems. Any help is greatly appreciated.
Thanks
turtle_patch