Hi all. I am using Crystal 11.5 and I am having a problem with a parameter I am trying to set. So far, I have the following:
SELECT "LND_PR_REVIEW_YN"."ID", "LND_PR_REVIEW_YN"."ASSET_ID",
"LND_PR_REVIEW_YN"."PID", "LND_PR_REVIEW_YN"."PROJ_DATE",
"LND_PR_REVIEW_YN"."RE_NOTES"
FROM "SDEADM"."LND_PR_REVIEW_YN" "LND_PR_REVIEW_YN"
WHERE "LND_PR_REVIEW_YN"."PID"='00186387' OR
"LND_PR_REVIEW_YN"."ASSET_ID"=0
ORDER BY "LND_PR_REVIEW_YN"."ID" DESC
I have the tables linked on the PID (Left outer join, not enforced) where LND_PR_REVIEW_YN is the left table.
PID is a character field (text) whereas ASSET_ID is an integer.
My need is to have the user be able to enter EITHER a PID, or an Asset_ID and get the related reviews. Sometimes the records in the PR_REVIEW table has both an Asset_ID AND a PID, but sometime it is one or the other.......
My select expert looks like this:{LND_PR_REVIEW_YN.ASSET_ID} = {?Query by AssetID} or
{LND_PR_REVIEW_YN.PID} = {?Query by PID}
and with this one, I can get all records in the PR_REVIEW table that have ONLY an ASSET_ID, or both an Asset_ID as well as a PID, by entering either one as a parameter. BUT I CANNOT RETRIEVE RECORDS THAT HAVE ONLY A PID.
If I reverse it, and have the select expert like this:
{LND_PR_REVIEW_YN.PID} = {?Query by PID}or LND_PR_REVIEW_YN.ASSET_ID} = {?Query by AssetID}
then I can get all records that have ONLY a PID, or both a PID and ASSET_ID, but I CANNOT RETRIEVE RECORDS THAT ONLY HAVE AN ASSET_ID.
What am I doing wrong???
Thanks!!
SELECT "LND_PR_REVIEW_YN"."ID", "LND_PR_REVIEW_YN"."ASSET_ID",
"LND_PR_REVIEW_YN"."PID", "LND_PR_REVIEW_YN"."PROJ_DATE",
"LND_PR_REVIEW_YN"."RE_NOTES"
FROM "SDEADM"."LND_PR_REVIEW_YN" "LND_PR_REVIEW_YN"
WHERE "LND_PR_REVIEW_YN"."PID"='00186387' OR
"LND_PR_REVIEW_YN"."ASSET_ID"=0
ORDER BY "LND_PR_REVIEW_YN"."ID" DESC
I have the tables linked on the PID (Left outer join, not enforced) where LND_PR_REVIEW_YN is the left table.
PID is a character field (text) whereas ASSET_ID is an integer.
My need is to have the user be able to enter EITHER a PID, or an Asset_ID and get the related reviews. Sometimes the records in the PR_REVIEW table has both an Asset_ID AND a PID, but sometime it is one or the other.......
My select expert looks like this:{LND_PR_REVIEW_YN.ASSET_ID} = {?Query by AssetID} or
{LND_PR_REVIEW_YN.PID} = {?Query by PID}
and with this one, I can get all records in the PR_REVIEW table that have ONLY an ASSET_ID, or both an Asset_ID as well as a PID, by entering either one as a parameter. BUT I CANNOT RETRIEVE RECORDS THAT HAVE ONLY A PID.
If I reverse it, and have the select expert like this:
{LND_PR_REVIEW_YN.PID} = {?Query by PID}or LND_PR_REVIEW_YN.ASSET_ID} = {?Query by AssetID}
then I can get all records that have ONLY a PID, or both a PID and ASSET_ID, but I CANNOT RETRIEVE RECORDS THAT ONLY HAVE AN ASSET_ID.
What am I doing wrong???
Thanks!!