We help IT Professionals succeed at work.

Displaying only first row for the 2nd Stored procedure

Sailee Govekar
I have two stored procedures in one report. My main stored procedure is procSSFTP_RPT_WorkAndRestDailyReport and 2nd stored procedure name is procSSFTP_RPT_GetCrewComments.

I want to display "Seafarer name" from my 1st stored procedure and "comments" from 2nd stored procedure.

I have multiple rows for the comments against the single seafarer name.

Instead of showing multiple rows of comments for single "seafarer name", I want to display one comment per "seafarer name".

Attached is the report for your reference

Watch Question

The details can be restricted to display only once for each Seafarer name and single comment (I think this will be the comment from the first record for each Seafarer) by displaying the details under Group header section by creating a group on seafarer name. But, you also have other details like Department and Rank. Will those also be constrained to a single row display for each Seafarer?
Or you just want to display all the records for each Seafarer name and display only the comment from first record for each Seafarer name?


We need to display top comment for each seafarer. Department and Rank will be single row.

Only the concern is with One seafarer and one comment.

Something like in attached report will do. But, when you say top comment for each seafarer name, is it the first comment or is it something associate with some value? If so, you may have to change the details accordingly. Currently, in the modified report, first comment for each seafarer will be displayed.


No.. its not specific. The very first comment.

and if the comment is NULL then also the seafarer name should be displayed



I have multiple seafarer names. if I delete the comments then all the seafarer names are displayed.

If I add comments field then only on record is displayed. Which is wrong.

There will be list of seafarer

That must be something to do with the link you have created between those 2 stored procs. Try changing the join from inner join to left outer or right outer join based on the data availability. You can use the report I shared (retain the comment field in the report) and check after changing the link join type.


Changing joins won't bring the correct data
Unless you change, you will not be able to get all the Seafarer details, as the ones apart from "Espinosa, Reyland Arante" might not have comments.
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Can you group by seafarer and display the information in the group header?
In that way only the first comment will be displayed.
To get it to work you need to change the join as mentioned.
Changing the join will work so long as you aren't filtering on the joined table



It worked after changing the Joins.
Earlier we were facing some problems with the Joins so couldn't do it. But now introduced some relations to handle in Stored procedure.