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

Distinct count of records

Status
Not open for further replies.

itsgenekramer

Technical User
Aug 21, 2003
122
US
I am trying to do a distinct count of records based on 2 fields that equal each other and a 3rd date range field for a particular time period. The 3rd date range field is if the date is within 10 days of the data date.

For example if the particular period is between 8/1/03 and 8/31/03 I only want to count those records where Field A = Field A and Field B = Field B and the data date of those records is within 10 days of each other.

Any help is appreciated.
 
Open the same table twice (Crystal will force you to assign the 2nd "copy" an alias).

Join them on
Table.A = Alias.A
and
Table.B = Alias.B

Add a record selection criterion whereby the date difference between Table.Date and Alias.Date is within your range.

Now you are ready to count the records.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top