debbie1212
Programmer
I'm trying to set this up so that it only gets those that have a REF_EMP_REC_DATE but it's returning a record that is in the CAC table but not the Referrals table. Therefore it's putting a NULL in the REFERRALS.REF_EMP_REC_DATE. I don't want it to return a record if there is not a record in Referrals or if REFERRALS.REF_EMP_REC_DATE is NULL.
This is my code:
CREATE Procedure sto_GetCases
@cac_chd_id int
AS
SELECT CAC.CAC_ID, REFERRALS.REF_EMP_REC_DATE,
CAC.CAC_CASE_NUMBER FROM CAC,REFERRALS
WHERE CAC.CAC_ID*=REFERRALS.REF_CAC_ID
AND CAC_CHD_ID = @cac_chd_id
AND REFERRALS.REF_EMP_REC_DATE > '1/1/1950'
ORDER BY CAC_ID
Thanks,
Debbie
This is my code:
CREATE Procedure sto_GetCases
@cac_chd_id int
AS
SELECT CAC.CAC_ID, REFERRALS.REF_EMP_REC_DATE,
CAC.CAC_CASE_NUMBER FROM CAC,REFERRALS
WHERE CAC.CAC_ID*=REFERRALS.REF_CAC_ID
AND CAC_CHD_ID = @cac_chd_id
AND REFERRALS.REF_EMP_REC_DATE > '1/1/1950'
ORDER BY CAC_ID
Thanks,
Debbie