Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need help for sql query

Author  Topic 

rajnidas
Yak Posting Veteran

97 Posts

Posted - 2014-08-05 : 01:23:59
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)

17689 Posts

Posted - 2014-08-05 : 03:27:43
[code]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[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajnidas
Yak Posting Veteran

97 Posts

Posted - 2014-08-05 : 04:39:36

thanks sir its working fine,


Thanks & regards

Rajnidas
Go to Top of Page
   

- Advertisement -