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!

How to access records in the same table but with a different filter

Status
Not open for further replies.

Greeham

Programmer
Feb 7, 2001
4
ES
Dear friends,
Can someone tell me how to access records in the same table but with a different filter?
That is, I have a table named F_DOCS of documents. There's a record named DO_TYPE which is used to sepparate different kind of documents (i.e. DO_TYPE = 1 The document is an InVoice, DO_TYPE = 2 is an Achieving, etc.)

The only way I've found is having a sub-report for every kind of document. Is there any other way to access them separately but in the same report?

Thanks. ;-)
 
Can you group by this DO_TYPE field and just have the records listed within the group? Or your report must contain records for only one specific document type?
 
Can you not use the 'Report Selection' wizard to specify only those entries that you wish to view on the report - for instance : {F_DOCS.DO_TYPE} = 1.
This can be set within the Crystal Report object itself or alternatively can be set at run-time if you are setting the report up through an external application (I use Delphi 5 and use the syntax 'CRReport.ReportSelection = "{Table.Field} = 1" for example.
Hope this helps ....
 
The problem I've found is that I want to access the data filtered by the record DO_TYPE, but I do not need ONLY one.

I must have a report like this:

Total of Invoices: 3 ---> Count({F_DOCS}) WHERE DO_TYPE=1
Total of Achieves: 2 ---> Count({F_DOCS}) WHERE DO_TYPE=2
Number of Documents: 5 ---> Count({F_DOCS})

I hope you'll help me now.

Thanks All !!
 
The ideas are all here, but let me put them together for you.

First select all the types you need by using the select expert to select where
Type - is one of
and then select all three values.

Now insert a group on this field to separate them into three different chunks. (Insert- Group)

Now highlight the TYPE field on the detail band and add a summary field that counts the records in each group. (Insert - Summary field) Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top