Hi,i need to create a Stored Procedure to display data as shown bellow----------------------------------------------SubmitDate Aster DBS Dogan3-Dec-08 34 2 1245-Dec-08 16 2 1208-Dec-08 18 9 10610-Dec-08 14 9 10311-Dec-08 14 9 9717-Dec-08 19 9 117----------------------------------------------
from the bellow database tablei need to pass MORE THAN 1 paremeter(submitdate ), then the result must be grouped on that parameter(submitdate)----------------------------shortid Product Submitdate----------------------------1 Aster 1/2/20092 Aster 1/2/20093 Aster 1/2/20084 Aster 1/2/20085 DBS 1/2/20086 DBS 1/2/20087 DBS 1/2/20078 Dogan 1/2/20079 Dogan 1/2/200710 Dogan 1/2/2007----------------------------
i tried something, but i could able to get only 1 row by passing 1 parameter ALTER PROC [dbo].[CQ_Progress]( @submitdate datetime)asselect @submitdate as 'Submit Date', sum(case when product like '%aster%' then 1 else 0 end) as [Aster],sum(case when product like '%DBS%' then 1 else 0 end) as [DBS],sum(case when product like '%Dogan%'then 1 else 0 end) as [Dogan]from defectall where submitdate< @submitdate
Please modify it so that i can pass multiple parameter.thanks