0

我想为特定的工程师安装详细信息创建一个水晶报表。在该报告中,我不想显示特定工程师的安装细节。

报告模型如下所示:

totalnoofinstallation  assignto  c_address   c_mobileno  package_det frm_date    to_date
  3                     FE01      Ramnagar    232345      xx         25-04-2012 05-04-2012

SQL Server 表数据如下所示:

p_id  assignto c_address C _mobileno  package_det  frm_date      to_date
 1      FE01    Ramnagar    232345      xx         25-04-2012    05-04-2012
 2      FE01    kknagar     232345     xx         03-04-2012    04-04-2012
 3      FE01    colony      232345      xx         01-02-2012    23-02-2012

我的程序是

create procedure sp_fldinstallationdeatils
(
   @assign varchar(20),
   @frmdate1 varchar(20),
   @todate1 varchar(20)
)
as
begin
   select 
      count(*) as tonofoinstallation, Assignto, 
      customer_address, customer_contactno, package_details, frmdate, todate   
   from 
      installation2 
   where 
      assignto='FE01' and frmdate ='25-04-2012' and todate= '05-04-2012' 
   group by 
      Assignto, customer_address, customer_contactno, package_details, frmdate, todate 
end    

但我的报告只显示(我想在我的报告中显示安装总数为 3)

totalnoof installation
 1

我不喜欢创建另一个程序来计算安装细节的总数。我在现有程序中进行了哪些更改以显示 totalnoofinstallation 的详细信息?请帮助我?

4

1 回答 1

0
select 
  count(*) as tonofoinstallation, Assignto, 
  customer_address, customer_contactno, package_details, frmdate, todate   
from 
  installation2 
where 
  assignto='FE01' and frmdate ='25-04-2012' and todate= '05-04-2012' 

条件 " and frmdate ='25-04-2012' and todate= '05-04-2012' " 将导致 sql 根据您提供的数据仅返回一行。

于 2012-04-18T18:04:43.357 回答