-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: BalajiKrishnan
Message 5 in Discussion

Dear Srini, This is working for MedRecNo,but when i pass only lastname or firstname,it 
is not fetching the records 
ALTER Procedure TESTPROC1 '','NAIR','' @PatientFName varchar(60)= NULL ,    
 @PatientLName varchar(60)= NULL ,      
 @MedRecNo varchar(2000)   
     
       
AS       --DECLARE @fname VARCHAR(60)
--DECLARE @lname VARCHAR(60)
--DECLARE @id varchar(200)
BEGIN
 -- SELECT @PatientFName = NULL, @PatientLName = NULL, @MedRecNo = NULL
    SELECT
        a.strMRN, a.strPatientFName, a.strPatientLName, 
a.strPatientCity,a.dtPatientDOB, 
        maxVisitID = ISNULL ((select max(b.intPatientVisitId) FROM 
tblmedicalrecorddetails  b WHERE b.FKstrPatientMRN = a.strmrn), 0)
    FROM
        tblmedicalrecordmaster a
    WHERE
        a.strPatientFName LIKE CASE WHEN @PatientFName IS NULL THEN '%' ELSE 
@PatientFName + '%' END AND
        a.strPatientlName LIKE CASE WHEN @PatientLName IS NULL THEN '%' ELSE 
@PatientLName + '%' END AND
        a.strmrn = CASE WHEN @MedRecNo IS NULL THEN a.strmrn ELSE @MedRecNo END
END


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to