Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bypassing records conditionally

Status
Not open for further replies.

MrFuzzwah

MIS
Mar 28, 2011
49
US
In my table below, I have multiple records that share an incident number (201311476). I need to check the JUVENILE flag and if it is 1 (like the first record) I need to bypass this incident record entirely.
That may seem simple but when the bigwigs want it NOW it gets harder - way harder.


agency incident suffix rec type inv num JUVENILE
01 201311476 00 1 V -1 1
01 201311476 00 2 R -1 NULL


Thanks!
 
Try a adding the following code to your Record Selection formula:

Code:
(
	IsNull({Table.Juvenile_Flg}) or
	{Table.Juvenile_Flg} <> 1
)

Cheers
Pete
 
First - thanks for the reply -

This does not quite work but I feel I'm on the right track. I need to check all records by incident and if any one of them is juvenile = 1 then omit all records for that incident. But if none of them are juvenile then print. Your code printed the second record in my example.

Thanks!
 
Juvenile will always be either 1 or NULL. There are multiple records per incident. If any incident record has a juvenile flag the entire incident has to be bypassed.

Thanks!
 
For this to work you will need to group the records by Incident #.

Create the following formula ({@JTest}):

Code:
If	IsNull({Table.Juvenile_Flg}) 
Then 	0
Else	1

Then, add the following to the Group Selection formula:

Code:
Maximum({@JTest}, {Table.Incident#}) = 0

Hope this helps

Cheers
Pete
 
Thank you both for your assistance. pmax9999's example worked. I have multiple files to do this on so I'm not so sure about the grouping per multiple files but surely if need be I can create several subreports.

Thanks!
 
I have 2 reports. One that creates a listing of records. I want to link with these records to another report that provides detail (but not on-demand - in one program run). I want all the main report listing to complete first and then the subreport for each item to complete. How do I force the main repeort to process fully prior to the subreport - which also will process fully?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top