1

We have copied a stored procedure created by another company to use for a report in crystal reports, which then runs from a software. All we need to do is add a column. We added

ACO varchar(10) NULL

within

create table #WorksheetAmounts

Then we added the following:

insert into #WorksheetAmounts
    (JCCo, Contract, Item, ChangeOrderAmt, ChangeOrderUnits, BillGroup, ACO)

   Select 
      JCOI.JCCo, JCOI.Contract, JCOI.Item, JCOI.ContractAmt, 
      JCOI.ContractUnits, JCOI.BillGroup, JCOI.ACO
   From 
      JCOH
   Join 
      JCOI on JCOH.JCCo = JCOI.JCCo AND JCOH.Job = JCOI.Job AND JCOH.ACO = JCOI.ACO
   where 
      JCOI.JCCo = @JCCo 
      and JCOI.Contract >= @BeginContract
      and JCOI.Contract <= @EndContract 
      and JCOI.ACO = JCOH.ACO 
      --and JCOH.ApprovalDate <= @COThroughDate
   Group by 
      JCOI.JCCo, JCOI.Contract, JCOI.Item, JCOI.ContractAmt, 
      JCOI.ContractUnits, JCOI.ContUnitPrice, JCOI.BillGroup, JCOI.ACO

When we use the stored procedure in Crystal Reports (through the database expert) the new ACO field is not there. We are clearly missing something, but I am unsure what.

I am new to SQL Server, so this is probably something super simple. Any help is appreciated!

4

1 回答 1

0

如果您创建了一次 SQL 命令并稍后添加了新字段,您将需要“刷新”该命令,以便它可以显示所有可用字段。为此,只需右键单击 Field Exporer 中的数据库字段,然后单击验证数据库选项。将弹出一条消息,告诉您数据库文件“FileName”已更改。继续修复报告。

于 2013-07-25T20:09:57.583 回答