SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 procedure related
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Somnath_lnt
Starting Member

India
1 Posts

Posted - 09/26/2012 :  00:19:33  Show Profile  Reply with Quote
SELECT tblplsrptextract1.strSpyIDocType AS SPYDOCTYPE
, SUM(CASE WHEN tblplsrptextract1.strusriproduct = 'APP-NEW' THEN 1 ELSE 0 END) AS APPNEW
, SUM(CASE WHEN tblplsrptextract1.strusriproduct = 'APP-RENEWAL' THEN 1 ELSE 0 END) as APPRENEWAL
FROM tblplsrptextract1

Now we want only
tblplsrptextract1.strusriproduct = 'APP-RENEWAL' to be present as field so that we can take that field in crystal report and take sum there, not in procedure..


Can someone help me on this???

I want to explore

Edited by - Somnath_lnt on 09/26/2012 00:24:07

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 09/26/2012 :  11:52:18  Show Profile  Reply with Quote
so do you mean removing the other sum field?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000