Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need to add fields to stored procedure Post Reply Post New Topic
Author Message
Jo6205
Newbie
Newbie
Avatar

Joined: 17 Aug 2015
Online Status: Offline
Posts: 3
Quote Jo6205 Replybullet Topic: Need to add fields to stored procedure
     Posted: 11 Sep 2015 at 6:23am
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]

------=======



     
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 Sep 2015 at 4:45am
You need to modify the SP to do it correctly.  I do not know what tools you have, but there is a lot of information on how create/modify stored procedures on the internet.
IP IP Logged
Jo6205
Newbie
Newbie
Avatar

Joined: 17 Aug 2015
Online Status: Offline
Posts: 3
Quote Jo6205 Replybullet Posted: 16 Sep 2015 at 4:49am
Thanks for your response. I never could figure it out but the person who had requested the changes decided she didn't need them.

Hopefully I'll learn how to make this type of change before I need it again.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum