Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query help
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Query help
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01398766
Message ID:
01398766
Vues:
103
Hi All,

Is there a way without using a cursor to have only one Calc column instead of 3 (Calc1, Calc2 & Calc3) based on the condition below?
select a.EDPNo, b.PVC, a.EachWeight,
		c.VendNo, c.TermsPct, c.FrtCharge, c.FreeFrt, c.FrtAsPct, c.FrtChargePct,
		--c.FreeFrt = 1
		(b.PVC - (b.PVC * (c.TermsPct / 100))) as Calc1, 
		--c.FrtAsPct = 1
		(b.PVC + (b.PVC * (c.FrtChargePct / 100))) - (b.PVC * (c.TermsPct / 100)) as Calc2, 
		--c.FreeFrt = 0 & c.FrtAsPct = 0
		(b.PVC + (c.FrtCharge * a.EachWeight)) - (b.PVC * (c.TermsPct / 100))  as Calc3
from DS1.dbo.ItemMst a join DS1.dbo.PItems b on a.EDPNo = b.EDPNo
	 inner join DS1.dbo.VendorMst c on a.VendNo = c.VendNo
Thanks,
Daniel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform