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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RETAIN ENTIRE RECORD 1

Status
Not open for further replies.

Kim296

MIS
Aug 24, 2012
98
US
I would greatly appreciate help if anyone has suggestions to my problem.

Key Word Search by Name Id (number)

In my file each record may contain one or more related name id's (number). I want to search the report by name id (number); however, I want it to pull all name ids related to the same case, excludeing records that do not contain the search name id.

The way that it's sorting records now:
Record 1 returns all information in group field.
Search name id only returns in the detail section

Record 2 returns all information in group field.
Search name id only returns in the detail section

The way that I want it to sort records:
Record 1 returns all information in group field.
Search Name id in details section
Name 2 id thats involved in details section
Name 3 id thats involved in details section
Name 4 id thats involved in details section

Record 2 returns all information in the group field.
Search name id in the details section
Name 2 id in the details section

Can anyone tell me how to only pull records that contain a certain name id included in the report and still show all other name id attached.
 
Not certain I understand it correctly. Assuming I do, this could be achieved by joining the "Name" table twice. Then use the first instance to limit the "Case" records associated to that "Name" and place the field from the second "Names" table in the details section to include all that are associated with the case.

When adding the table he second time, Crystal will warn you that it is already there and offer to add it with an Alias.

If you need further assistance it would be helpful if you could post some specific details of table/column names so we can be a bit more specific.

Hope this helps
Pete
 
Thank you Pete,

I work for a police dept. I want to pull up all case files that contain a specific "nameid" without filtering out any other names that are involved with this case. Right now, I have the report Grouped by the case number {lwmain.inci_id}. I also have the report information itself in the group header: {lwmain.inci_id}, {lwmain.agency}, {lwmain.date_rept}, {lwmain.offense}, {lwmain.street}, {lwmain.name_id}.
Then I have {lwmain.name_id} in the details section by itself, so that it will list all of the names involved with this case number.

My dilemma is that is shows the information in the right layout, but I can find a way to show files that contain certain nameid's. All I can figure out is how to filter certain ids. I did try filtering the {lwmain.name_id}, but it filters it in both the group header and the details section. It pulls the right reports, but only with that specific name. I need it to pull those reports AND show all other names involved too.

I don't know if this helps explain any better, but if it does and someone knows a fix, please share!
 
Based on this post, it seems that all the data you need is in the table called lwmain, in which case try this:
[ul]
[li]Add the lwmain table to the report a second time. Crystal will tell you it is already there and offer to name it lwmain_1 [/li]
[li]Join the two tables instances of the same table on case_id[/li]
[Li]Base your Record Selection on the lwmain_1 columns, but display columns based on lwmain (ie, don't change what you currently have in the Group and/or Details sections) [/li]
[Li]If you need to include other tables, join them to lwmain[/li]
[/ul]

Effectively, you are using lwmain_1 to determine which case_id to pick based on the name_id, but by displaying the data from the other table you will see all name_id s associated with that case_id.

Hope this help.

Cheers
Pete
 
Thank you so much Pete,

Your solution worked perfectly!!! Thank you for your help :)

Cheers,
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top