Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear experts

SQL
CASE WHEN isnull(SUM(Opening) ,0))<0 THEN
      --Here i need to make two columns One with the value of opening and another with zer0

    ELSE
      --Here i need to make two columns One with the value of opening and another with zer0CAST -

How can i do that, I tried something but nothing works fine.
I am very new to sql and let me know is there any another method to achieve this

Please help me sir
Posted
Comments
Adarsh chauhan 14-Aug-13 1:52am    
your question is not clear..explain little more..

well you can use case like..

CASE WHEN SUM(isnull(Opening,0))<0 THEN --Do somthing
ELSE --do something
end
Maciej Los 14-Aug-13 2:30am    
Not clear... ;(
Please, post example data and expected output.
kankeyan 14-Aug-13 3:58am    
Concat the two columns

1 solution

Edit and try this:-

SQL
select Column_Name= CASE Column_Name WHEN SUM(isnull(Opening,0))< 0 THEN '' ELSE 'do something' END from table_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