Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gamaz
Posting Yak Master
104 Posts |
Posted - 2009-05-18 : 15:22:22
|
Hi,I have the following lines as a part of a complex view. However the following lines when added to the view does not parse. When I am removing the following lines the view parses. I would appreciate any help to help resolve this issue. ThanksCODE:CAST(COALESCE (qrptCartonsDone.CtnsDone, 0.00) * tblParts.PcsPerCtn / 1000.0 * tblParts.HrsPer1000 AS DECIMAL(10, 2)) AS HrsSpent, CASE WHEN CAST(COALESCE (qrptCartonsDone.CtnsDone, 0.00) * tblParts.PcsPerCtn / 1000.0 * tblParts.HrsPer1000 AS DECIMAL(10, 2)) > 0 THEN ROUND(tblOrders.Quantity / 1000.0 * tblParts.HrsPer1000 + tblParts.SetUpHours, 2) - CAST(COALESCE (qrptCartonsDone.CtnsDone, 0.00) * tblParts.PcsPerCtn / 1000.0 * tblParts.HrsPer1000 AS DECIMAL(10, 2)- tblParts.SetUpHours else ROUND(tblOrders.Quantity / 1000.0 * tblParts.HrsPer1000 + tblParts.SetUpHours, 2) - CAST(COALESCE (qrptCartonsDone.CtnsDone, 0.00) * tblParts.PcsPerCtn / 1000.0 * tblParts.HrsPer1000 AS DECIMAL(10, 2)) As hrstorun, |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2009-05-18 : 15:27:07
|
Looks like you're missing an END statement.CASE ... WHEN ... THEN ... ELSE ... END As ...--------------------------------------------Brand yourself at EmeraldCityDomains.com |
|
|
|
|
|
|
|