Hi Everyone! Thank you for reviewing my cry for help.
Let me say first that I’m just now learning how to work with stored procedures in SQL and the procedure I need help with I did not write. I have added fields and manipulated code so I can get my Crystal reports to work but I’ve not yet built a stored procedure from scratch.
Having said that, I’m working with a procedure and need to add three fields to the SELECT list.
The main table (JCJM) where the other tables are joined has a left join to a secondary table (JCCM) on fields JCCo and Contract. I need to add table ARCM but there is no matching field in JCJM for linking. There is a field in JCCM (Customer) where I can join ARCM.
I’ve tried a subreport, Union, Select, and Insert but I can’t figure out how to add ARCM to the query. I need to have Customer, Name, and SortName from ARCM.
Will you please tell me what I’m missing?
Where I need to add the fields:
---=====
SELECT JCJM.JCCo
,@COName AS [COName]
,JCJM.Contract
,JCJM.udstartdate as [StartDate]
,JCJM.udenddate as [EndDate]
--,JCCM.ProjCloseDate AS [EndDate]
,JCJM.udJobComplete as [Job%Complete]
,cf.Item
,JCJM.Job
,JCJM.JobStatus
,AA.Name
,AA.SortName
,JCJM.udNotToExceedPO
,JCJM.Description AS [JobDesc]
,JCCI.BillType AS [JobType]
,JCJM.ProjectMgr AS [PMNumber]
,JCMP.Name AS [PMName]
,JCJM.udEACCost AS [ud_EAC_Cost]
,JCJM.udEACRev AS [ud_EAC_Rev]
,PMPN.udAddDate
,PMPN.udNotes
,PMPN.Notes
,cf.OrigEstHours
,cf.CurrEstHours
,cf.ActualHours
,cf.OrigEstCost
,cf.CurrEstCost
,cf.ActualCost
,cf.ContractAmt
,cf.BilledAmt
,cf.ReceivedAmt
,cf.CommittedCost
,cf_ap.APAmount
,0 AS [OverrideCost]
------=======