Skip to content

Instantly share code, notes, and snippets.

@chadsten
Created November 30, 2016 19:14
Show Gist options
  • Save chadsten/3d55002a381a26247398a91ea94c0edd to your computer and use it in GitHub Desktop.
Save chadsten/3d55002a381a26247398a91ea94c0edd to your computer and use it in GitHub Desktop.
CASE
WHEN (PartPlant.LeadTime <= '7')
THEN CONVERT(DECIMAL(16, 4), CEILING((MonthAvg * 1) * 1.1))
WHEN (PartPlant.LeadTime > '7' AND PartPlant.LeadTime <= '14')
THEN CONVERT(DECIMAL(16, 4), CEILING((MonthAvg * 1.2) * 1.1))
WHEN (PartPlant.LeadTime > '14' AND PartPlant.LeadTime <= '30')
THEN CONVERT(DECIMAL(16, 4), CEILING((MonthAvg * 1.5)) * 1.1)
WHEN (PartPlant.LeadTime > '30')
THEN CONVERT(DECIMAL(16, 4),CEILING((MonthAvg * 2) * 1.1))
END AS SugMax
@chadsten
Copy link
Author

Is returning X.X0 instead of X.00

@chadsten
Copy link
Author

EG:

CONVERT(DECIMAL(16, 4),CEILING((1.75 * 2) * 1.1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment