Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Another Suppress Question Post Reply Post New Topic
Page  of 5 Next >>
Author Message
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Topic: Another Suppress Question
    Posted: 20 Feb 2010 at 2:00pm

Let me begin by saying thank you for all your help. This is a great forum!

Here is my new problem.

These are the fields:

 {Audit_Trail.FieldName}

{Audit_Trail.AfterValue}

{Audit_Trail.BeforeValue}

{Audit_Trail.DateStamp}

 

In the report it shows this:

Field Name: Temporary_Out     

Before Value:  0

After: 1

Date: 02/04/2010

 

Then when inmate comes back:

Field Name: Temporary_Out     

Before Value:  1

After: 0

Date: 02/08/2010

 

If I do a (date parameter) of say 02/06/10 I do not want the inmate to show in the report. But if I do a date parameter of 02/09/10 I want to see him. And there are multiple other Temporary_Out ‘s for the inmate. So let’s say the inmate has not come back in yet there will not be a Temporary_Out listed yet, until he is back in then the value will change from 1 back to 0.

 

How do I create a formula to suppress this type of inmate but show all others that do not have the Field Temporary_Out?

 

The formula that I was working on was something like this:

if {Audit_Trail.FieldName} = "Temporary_Out"

and {Audit_Trail.AfterValue} = "1"

and {Audit_Trail.DateStamp} <= {?date}

then 1 else 0

 

But I get all the other Temporary_Out <= {?date} and the inmate that is out has nothing. I can’t figure this out. There has to be something with an in between or something with the dates.

 

Thanks for the help in advance.

IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 22 Feb 2010 at 2:36pm
Basically how can I do a date parameter to search between two different date fields?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Feb 2010 at 2:51pm
The issue is that the dates are on differnent rows of data. If you can write a stored proc/view to combine the two related rows into one then it would be that straight forward for the date param but this is more complicated.

Edited by DBlank - 22 Feb 2010 at 2:52pm
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 22 Feb 2010 at 4:51pm

I believe the fields that I am pulling from are from a view table. What would be needed after that?

IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 23 Feb 2010 at 7:09am
Ok so I got to thinking last night, what if I can kind of trick the system. Is there anyway to select odd numbers?
 
What I was thinking is this.
 
If {Audit_Trail.FieldName}  = "Temporary_Out"

and {Audit_Trail.DateStamp} <= {?date}

then 1 else 0

Then do an Insert Summary as a Sum of the above and that would give me the numbers. If the numbers were odd that meant they were out of the jail. If even they would be back in.

So I how would you select the odd numbers, by the {?date} and do you think that would work?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Feb 2010 at 7:13am
Well it is not just using a view but rather creating a view that would combine your two matching rows into a single row.
There may be another approach but a few questions first t make sure i understand your set up.
1. everytime a inmater gors 'out' a row is created with aftervaule=0 and everytime they retunr a new row is created with aftervalue=1, correct?
2. If an inmate has never had a temp_out are they in the table at all, and if not do you need the name to appear in the report (because they are currently "in").
3. since you are using a date param here are you trying to show a list for that day or since that day? or eaxample if you enter 1-5-2010 and an inmate was out from 1-1-2010 to 1-15-2010  and then out again on 2-1-2010. the inmate was gone on your param date but also returned and left again. Do you include or excldeu them and why?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Feb 2010 at 7:13am
Sorry, just read your odd row question. Depends, please see my post and explain how you are handling the data.
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 23 Feb 2010 at 8:16am
1. Yes - when they go out I get a  row beginvalue = 1 and aftervalue = 0 with the datestamp and then the opposite for when they return - beginvalue = 0 aftervalue = 1
2. yes they are in the table and yes I need them in the report.
3. show a list for that day or since that day? For that day
The reseason we exclude them is because they are not in the jail because of either they are on a furlough ( not our respondsiblity ) or are in another jail for court. And then that jail has to count them as being there. All has to do with state statues. If they are physically in your facility you count them.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Feb 2010 at 8:22am

OK and yuck.

So if they have never been furloghed you would have a NULL in the {Audit_Trail.FieldName}?
Is there another field in the table to identify a furlogh 'row pairing' or is is just the flip on the 0/1 value?
IP IP Logged
hugo69
Groupie
Groupie


Joined: 15 Feb 2010
Online Status: Offline
Posts: 53
Quote hugo69 Replybullet Posted: 23 Feb 2010 at 10:49am
That would be correct about the NULL and it just flips on the 0/1 value.
IP IP Logged
Page  of 5 Next >>
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.000 seconds.