Let say I have the following 2 tables:
Table A:
CompanyCode
LocationCode
FormNumber
EmployeeNumber
...
Table B:
CompanyCode
LocationCode
FormNumber
EmployeeNumber
ClaimDate
...
Table A and Table B is joined using all the 4 parameters (CompanyCode,LocationCode,FormNumber,EmployeeNumber). These 4 parameters will be input for the report.
One row in table A can have multiple rows in table B.
In the Crystal Report, for each record in table A, I want only the row with the earliest ClaimDate in table B.
Using SQL, this can be accomplished using:
SELECT *
FROM TableA a
INNER JOIN TableB b ON
a.CompanyCode = b.CompanyCode AND
a.LocationCode = b.LocationCode AND
a.FormNumber = b.FormNumber AND
a.EmployeeNumber = b.EmployeeNumber
WHERE a.CompanyCode = @CompanyCode AND
a.LocationCode = @LocationCode AND
a.FormNumber = @FormNumber AND
a.EmployeeNumber = @EmployeeNumber AND
b.ClaimDate IN
(SELECT MIN(b.ClaimDate)
FROM TableB b
WHERE b.CompanyCode = @CompanyCode AND
b.LocationCode = @LocationCode AND
b.FormNumber = @FormNumber AND
b.EmployeeNumber = @EmployeeNumber )
But I'm not so sure how I can do this in Crystal Report. I tried using SQL Expression, but it seems SQL expression cannot pass the report input.
Amount, so it will be theAmountof the earliest date. Then thisAmountwill be converted to other value, using the currency table. If this amount exceeds some specific value, it will surpress one section and display another. Vice versa. So I'm thinking the above as the inital step to solve this problem. - rcssupressasif recordnumber=1 then false else true.. This is just an idea.. not sure whether it will work.. give it a try - Siva