Answered by:
Increasing a dollar amont by a percentage

Question
-
how do I increase a dollar amount by a precentageTuesday, February 1, 2011 9:25 PM
Answers
-
Hi,
Can you describe the expected resultset with table design? Do you want something similer to shown below?with CTE as ( select 2000 as yearNumber, 50 as amount union all select 2001 ,100 union all select 2002 ,150) select a.yearNumber,((a.amount - cast(b.amount as decimal(19,4)) )/ b.amount ) * 100 as increasePercentage from CTE a inner join CTE b on a.yearNumber -1 = b.yearNumber
-Chintak (My Blog)
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 2, 2013 5:01 PM
Tuesday, February 1, 2011 10:38 PM -
how do I increase a dollar amount by a precentage
increase by 15%DECLARE @Amount MONEY = 1 SET @Amount = @Amount * 1.15 SELECT @Amount
Vishal Gajjar- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 2, 2013 5:01 PM
Wednesday, February 2, 2011 2:39 AM
All replies
-
Hi,
Can you describe the expected resultset with table design? Do you want something similer to shown below?with CTE as ( select 2000 as yearNumber, 50 as amount union all select 2001 ,100 union all select 2002 ,150) select a.yearNumber,((a.amount - cast(b.amount as decimal(19,4)) )/ b.amount ) * 100 as increasePercentage from CTE a inner join CTE b on a.yearNumber -1 = b.yearNumber
-Chintak (My Blog)
- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 2, 2013 5:01 PM
Tuesday, February 1, 2011 10:38 PM -
how do I increase a dollar amount by a precentage
increase by 15%DECLARE @Amount MONEY = 1 SET @Amount = @Amount * 1.15 SELECT @Amount
Vishal Gajjar- Marked as answer by Ed Price - MSFTMicrosoft employee Tuesday, April 2, 2013 5:01 PM
Wednesday, February 2, 2011 2:39 AM -
Any progress?
Premature optimization is the root of all evil in programming. (c) by Donald Knuth
Naomi Nosonovsky, Sr. Programmer-Analyst
My blogSunday, February 13, 2011 10:44 PM