Click here to Skip to main content
16,018,158 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to calculate monthly fees collected from fees table and remaining fees from invoice table in percentage form
Posted

1 solution

SQL
WITH MonthlyFee
AS (
	SELECT
		SUM(fee) AS MonthlyFees -- Query to calculate monthly fee percentage
	FROM
		Fee
		),
RemainingFee
AS (
	SELECT
		SUM(fee) AS RemainingFees  -- Query to calculate Remaining Fees percentage
	FROM
		Invoice
	)
SELECT
	MonthlyFees,RemainingFees
FROM
	MonthlyFee,
	RemainingFee;
 
Share this answer
 
Comments
Member 11026061 10-Oct-14 3:33am    
Thanks Ankit it works as i want

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