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
 need help for sql query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rajnidas
Yak Posting Veteran

India
87 Posts

Posted - 08/05/2014 :  01:23:59  Show Profile  Reply with Quote
hi all ,

i need to addition to column which i given below.

SELECT
CASE
WHEN UPPER(f.newact) = 'N'
THEN c.numberofleavesnew
WHEN UPPER(f.newact) = 'R'
THEN c.numberofleaves
END AS Number_of_Leaves
, f.STRT_SER

FROM finacle_upload_detail AS f INNER JOIN cheque_master AS c ON c.schemecode = f.schcd.

getting result.
----------------------
numberofleaves STRT_SER
50 12300
25 45200
30 14522


i need to addition this two column kindly need help


Thanks\
Rajnidas

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 08/05/2014 :  03:27:43  Show Profile  Reply with Quote
select *, numberofleaves + STRT_SER
from
(
SELECT
CASE
WHEN UPPER(f.newact) = 'N'
THEN c.numberofleavesnew
WHEN UPPER(f.newact) = 'R'
THEN c.numberofleaves
END AS Number_of_Leaves
, f.STRT_SER

FROM finacle_upload_detail AS f INNER JOIN cheque_master AS c ON c.schemecode = f.schcd.
) d



KH
Time is always against us

Go to Top of Page

rajnidas
Yak Posting Veteran

India
87 Posts

Posted - 08/05/2014 :  04:39:36  Show Profile  Reply with Quote

thanks sir its working fine,


Thanks & regards

Rajnidas
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