Howdy folks, Im using Crystal Reports 8.5 using an ODBC connection to a Progress 9.1D Database. I seem to be having a problem using DISTINCT, mabey im doing it wrong. I tried adding DISTINCT infront of the field in the select portion of the SQL, like DISTINCT address1."Name" but it doesn't seem to work. I want to have select only distinct values from 3 fields, address1, address2, address3.
Here is my SQL statement:
SELECT
Customer1."Name",
ShipTo1."Address1", ShipTo1."Address2", ShipTo1."City", ShipTo1."State", ShipTo1."ZIP", ShipTo1."ShipToNum", ShipTo1."Company", ShipTo1."Address3",
CustCnt1."Name", CustCnt1."FaxNum", CustCnt1."PhoneNum"
FROM
"PUB"."Customer" Customer1,
"PUB"."ShipTo" ShipTo1,
"PUB"."CustCnt" CustCnt1
WHERE
Customer1."CustNum" = ShipTo1."CustNum" AND
Customer1."Company" = ShipTo1."Company" AND
ShipTo1."Company" = CustCnt1."Company" AND
ShipTo1."CustNum" = CustCnt1."CustNum" AND
ShipTo1."ShipToNum" = CustCnt1."ShipToNum" AND
Customer1."Name" <> 'Bortek Industries' AND
ShipTo1."Company" = '101' AND
ShipTo1."ShipToNum" <> '999'
ORDER BY
ShipTo1."ShipToNum" ASC,
Customer1."Name" ASC
Thanks for any help!
Here is my SQL statement:
SELECT
Customer1."Name",
ShipTo1."Address1", ShipTo1."Address2", ShipTo1."City", ShipTo1."State", ShipTo1."ZIP", ShipTo1."ShipToNum", ShipTo1."Company", ShipTo1."Address3",
CustCnt1."Name", CustCnt1."FaxNum", CustCnt1."PhoneNum"
FROM
"PUB"."Customer" Customer1,
"PUB"."ShipTo" ShipTo1,
"PUB"."CustCnt" CustCnt1
WHERE
Customer1."CustNum" = ShipTo1."CustNum" AND
Customer1."Company" = ShipTo1."Company" AND
ShipTo1."Company" = CustCnt1."Company" AND
ShipTo1."CustNum" = CustCnt1."CustNum" AND
ShipTo1."ShipToNum" = CustCnt1."ShipToNum" AND
Customer1."Name" <> 'Bortek Industries' AND
ShipTo1."Company" = '101' AND
ShipTo1."ShipToNum" <> '999'
ORDER BY
ShipTo1."ShipToNum" ASC,
Customer1."Name" ASC
Thanks for any help!