October 20, 2007 at 10:46 am
Hi,
IF the bill amount is $500.... How do I construct the SQL statement the first $300 taxable at 3% and the balance $200 at 1%?
Appreciate your help!
October 20, 2007 at 11:16 am
SELECT
taxAmount = CASE
WHEN billAmount > 300 THEN
(300 * .03) + ((billAmount - 300) * .01)
ELSE
billamount * .03
END
FROM
....
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgOctober 22, 2007 at 2:33 am
Hi, sorry I am new and training to learn.
Can you advise the reason required for the below statement...
taxAmount = CASE
October 22, 2007 at 5:29 am
Try reading up on the CASE statement in BOL (Books On Line)
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/658039ec-8dc2-4251-bc82-30ea23708cee.htm
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgOctober 22, 2007 at 5:30 am
Oh, and NO REASON to apologize. We all learn. 😀
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgViewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply