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
 Dividing two CAse statements

Author  Topic 

clewis99
Starting Member

3 Posts

Posted - 2007-03-09 : 17:03:04
How do I divide these two case statements:

1. sum(CASE WHEN o.sap_apc_indic is null THEN wip.wip_oth_exp_amt
ELSE 0
END) Markup,

2. sum(CASE WHEN o.sap_apc_indic is not null THEN wip.wip_oth_exp_amt
ELSE 0
END) AP,

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-09 : 17:20:41
If you mean, how do you divide the first one by the second one

sum(CASE WHEN o.sap_apc_indic is null THEN wip.wip_oth_exp_amt
ELSE 0
END) / sum(CASE WHEN o.sap_apc_indic is not null THEN wip.wip_oth_exp_amt
ELSE 0
END) ColName,
Go to Top of Page
   

- Advertisement -