Click here to Skip to main content
15,946,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi this is Ramesh.

i wrote the sql query(bellow). Actually the temp table #tblx have data. But when i am passing as select query it will return zero.

Please help me...

CREATE TABLE #TblX( Code varchar(20))
DECLARE @TblY TABLE(Code varchar(20))
SELECT distinct Code FROM tbl_MainList

SELECT  feorcre,ClientID,[#TblX]
(SELECT distinct Code,feorcre,ClientID
FROM tbl_MainList where FeorCRE=@FeorCre  ) As Souce
PIVOT (COUNT(Code) FOR Code IN ([#TblX])) As p
Updated 2-Apr-12 23:29pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900