Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
DECLARE @MaxComm decimal (3,2) SET @MaxComm = ( select max(CommissionPercentage) from tblCommissionTiers) SELECT DISTINCT empNum, gross as SALES ,targ.SalesTarget AS TARGET , lowPercentage,highPercentage, CommissionPercentage ,gross*lowPercentage AS LowAmount ,gross*highPercentage AS HighAmount ,(gross*highPercentage) - (gross*lowPercentage) VarHighVsLow ,CASE WHEN gross > targ.SalesTarget THEN ((gross*highPercentage) - (gross*lowPercentage)) * CommissionPercentage WHEN (gross - targ.SalesTarget) > 100.00 THEN (gross - targ.SalesTarget) * @MaxComm ELSE 0 END COMMISSION FROM tblRevenues rev INNER JOIN tblCommissionTiers com ON rev.commissionFlag = com.commissionFlag INNER JOIN [dbo].[tblTargets] Targ ON com.commissionFlag = targ.commissionFlag GROUP BY empNum, gross,targ.SalesTarget , lowPercentage ,highPercentage, CommissionPercentage
|Syntax issue with my Where Clause SQL 2012||20||38|
|How do I figure out how much database is expected to grow?||15||72|
|Need sql in string||2||28|
|SQL works but want to get the XML node data separately||11||25|