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

Returning only the first record from a table

Status
Not open for further replies.

griffter

Programmer
Oct 17, 2005
36
GB
Hi
Hope someone can help.

I only want to display the first record from a table, the best scenario would be that all the first record items from the linked tables are only returned, if this is not possible can I write a formula that displays the first record from each table?

thanks di
 
In Crystal, a 'table' is a dataset or file. Is this what you mean?

To return just one record from a group, you suppress the details and group footer and show record details in the group header. This will be the first record of the group, depending on how you sort it. (Report > Sort Expert.)

You can do this for an entire dataset by defining a group that includes everything.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks for this Madawc, i was hoping i could avoid bringing down all the records by using a record selection formula? The table i am pulling down can have a lot of records
 
There is File > Print > Preview Sample, as a temporary measure.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi,
You could use a Command to replicate the Sql for your report ( use the ShowSql and copy it) - and add
and rownum < 2 to the code..

( or whatever your database uses to restrict the # of records returned)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top