Can you give me some sample data?
How to simplify this long if else statement?
Collapse
X
-
So then you don't actually have fields named tax1, discount1, etc.?
Then everything can be handled with a SQL statement. It depends on what SQL server you're using but for Microsoft SQL Server, I would do something like this
Code:SELECT (SUM(price) - SUM(CASE discount WHEN 100 THEN tax ELSE 0 END) ) AS total_price FROM Table1
Comment
Comment