Dark0Prince
Active Member
- Joined
- Feb 17, 2016
- Messages
- 433
So below is my SQL query, but when I add the client.name it pulls every client in the system instead of just the one that has the one account i'm searching for in it. Is there a way to join one table to another to show me just the client's name on that one account?
Rich (BB code):
Select
DCGI.Client,
DCGI.Account_Num1,
DCGI.Date_Listed,
DGI.Last_Name,
DGI.First_Name,
DGI.Rp_Last_Name,
DGI.Rp_First_Name,
DGI.Address_Line_1,
DGI.Address_Line_2,
DGI.City,
DGI.State,
DGI.Zip_Code,
PH.Pay_Date,
PH.Occurence_Date,
PH.Amt_Applied,
PH.Bal_Before_Tran,
PH.Bal_After_Trans,
DS.Paid_In_Full_Date,
CG.CLIENT_NAME,
PIFR.PIF_CB_DEL_REQU
From
Dbtr_Clnt_Generl_Inf DCGI
LEFT JOIN Dbtr_General_Inf DGI ON DCGI.Account_Num1=DGI.Account_NUM1
LEFT JOIN Clnt_General CG ON DCGI.Client=DCGI.Client
LEFT JOIN Payment_History PH ON DCGI.Account_Num1=PH.Account_NUM
LEFT JOIN Dbtr_Status DS ON DCGI.Account_NUM1=DS.ACCOUNT_NUM1
LEFT JOIN DU_PAID_IN_FULL_REQUEST PIFR on PIFR.Account_Num1=DGI.Account_Num1
WHERE
DCGI.Client = ?
And
DCGI.ACCOUNT_NUM1 = ?