New to using SQL - I created a view and need to add a field for the Quantity Field, I need this field to exclude one product line in my table. However, I need the Product Line on the entire table but just filtered for the quantity field. Is there a way to do this?
For example - My QTY field includes Freight. My $$ fields need to include the Freight $$'s so I can't eliminate the Freight from the entire table I just don't want the QTY field to include the Freight numbers, as it doubles the Qty Amount.
In Crystal - I would create a formula as:
If {ProductLine} = "FRGT" then 0 else {Qty}
Any help would be great! Trying to not do this report in Crystal.
Thank you.
Using MS SQL Management Studio - 2008 R2 - Free version
Case ProductLine
"FRGT" : Cost
Others : Cost * Qty
End As ExtendedCost
mlmcc
0
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!
Can you post your data model?
Regards,
AielloJ