0

特定のエンジニアのインストールの詳細について Crystal Report を作成したいと考えています。そのレポートでは、特定のエンジニアのインストールの詳細を表示したいと思います。

レポート モデルは次のようになります。

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 は、指定したデータに従って 1 行のみを返します。

于 2012-04-18T18:04:43.357 に答える