Zaarinn Zaarinn - 1 year ago 62
SQL Question

Is it possible to do a query for a specific value, whereby it is increased by a percentage?

This may seem like a hard question to understand; I'm brand new to any types of coding and scripting and therefore I cannot explain this better than I have, sorry :)

I have been tasked with writing and executing a query for the following requests: "Output the sales order ID, order date, subtotal, and the tax amount increased by 2.5% for each sales order." That last section is where the problem arises. I have been able to bring up a super simple table by just entering:

SELECT SalesOrderID, OrderDate, SubTotal, TaxAmt
FROM SalesLT.SalesOrderHeader

When I executed this the table worked as intended, but my problem comes when I am asked to have the tax amount "increased by 2.5%"; what does this mean?

Again, sorry if my explanation isn't very useful; it's the best I can provide.

If you need any extra information, please let me know :)

Answer Source

You need to add like this.

SELECT (TaxAmt * 1.025) as tax
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download