Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SELECT A.BRNNAME,A.SCORE , COALESCE(A.Q1Y1C, 0) Q1Y1C , COALESCE(C.Q1Y2C, 0) Q1Y2C    ,
                            COALESCE(A.Q2Y1C, 0) Q2Y1C , COALESCE(C.Q2Y2C, 0) Q2Y2C    ,
                            COALESCE(A.Q3Y1C, 0) Q3Y1C , COALESCE(C.Q3Y2C, 0) Q3Y2C    ,
                            COALESCE(A.Q4Y1C, 0) Q4Y1C , COALESCE(C.Q4Y2C, 0) Q4Y2C    ,
                            ROUND(COALESCE(B.Q1Y1P, 0.00),2) Q1Y1P , COALESCE(ROUND(D.Q1Y2P,2), 0.00) Q1Y2P    ,
                            COALESCE(ROUND(B.Q2Y1P,2), 0.00) Q2Y1P , COALESCE(ROUND(D.Q2Y2P,2), 0.00) Q2Y2P    ,
                            COALESCE(ROUND(B.Q3Y1P,2), 0.00) Q3Y1P , COALESCE(ROUND(D.Q3Y2P,2), 0.00) Q3Y2P    , 
                            COALESCE(ROUND(B.Q4Y1P,2), 0.00) Q4Y1P , COALESCE(ROUND(D.Q4Y2P,2), 0.00) Q4Y2P
         FROM  Y1C A
         INNER JOIN  Y1P B  ON A.BRNNAME=B.BRNNAME AND A.SCORE=B.SCORE
         INNER JOIN  Y2C C  ON A.BRNNAME=C.BRNNAME AND A.SCORE=C.SCORE
         INNER JOIN  Y2P D  ON A.BRNNAME=D.BRNNAME AND A.SCORE=D.SCORE
         ORDER BY A.BRNNAME


What I have tried:

Codes under construction tried the following but not working
Posted
Updated 20-Nov-17 16:37pm
Comments
phil.o 20-Nov-17 14:09pm    
Could you give an example of the values which are stored in the columns as well as the displayed results of the round operation?

1 solution

cast(Round((ColumanName),2) as decimal(18,2)) as [Name]
 
Share this answer
 

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