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.
Author |
Topic |
mimuk
Starting Member
19 Posts |
Posted - 2013-09-06 : 07:38:38
|
Forgive me for not getting my head around this.I have 3 columns when I select quant, pric, disc from dbo.ququoteitems tablequan pric disc1 100 -501 50 -1020 10 -50 I need to create a derived field in the view that shows the sale pricei.e in the first row 1 * 100 then apply discount of 50%. The disc column includes a minus sign quan pric disc total to show1 100 -50 50 1 50 -10 4520 10 -50 100 Cheers in advance Mim |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-09-06 : 07:49:47
|
SELECT *, (quan*pric) + ((quan*pric)*disc/100) "total to show"FROM dbo.ququoteitems --Chandu |
|
|
mimuk
Starting Member
19 Posts |
Posted - 2013-09-06 : 07:56:07
|
Perfect ChanduThanks for the quick response |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-09-06 : 07:56:34
|
quote: Originally posted by mimuk Perfect ChanduThanks for the quick response
Welcome--Chandu |
|
|
|
|
|