Я получаю эту ошибку:
Произошла ошибка при выполнении определения команды. Подробности см. Во внутреннем исключении
SqlException: Процедура или функция SP_WEB_MS3DailyReport_DailyEquipmentDeviation_SelectByDate имеет слишком много аргументов, указанных.
Мой код:
ALTER PROCEDURE [dbo].[SP_WEB_MS3DailyReport_NonBuilDeviation_SelectByDate]
(@FromDate datetime,
@EndDate datetime)
AS
BEGIN
SELECT
JobHead,
ISNULL(MeasurementPlanned, 0) AS MeasurementPlanned,
CASE
WHEN Deviation IS NULL THEN CONVERT(Numeric(18, 2), 0)
ELSE CONVERT(Numeric(18, 2), MeasurementReport)
END AS MeasurementReport,
CASE
WHEN MeasurementReport IS NULL THEN -(MeasurementPlanned)
ELSE Deviation
END AS Deviation,
CASE
WHEN MeasurementPlanned IS NULL AND Deviation > 0 THEN 'btn-info'
WHEN Deviation = 0 THEN 'btn-primary'
WHEN Deviation > 0 THEN 'btn-success'
WHEN Deviation < 0 THEN 'btn-danger'
WHEN Deviation IS NULL THEN 'btn-warning'
END AS Indicater,
ProjectSiteName, ProjectSiteID
FROM
(SELECT
DailyNonBuildReviewDeviation.[JobHead],
CONVERT(Numeric(18, 2), NextDayNonBuildPlan.Measurement) AS MeasurementPlanned,
CONVERT(Numeric(18, 2), DailyNonBuildReport.Measurement) AS MeasurementReport,
CONVERT(Numeric(18, 2), DailyNonBuildReviewDeviation.Measurement) AS Deviation,
ProjectSiteName, DailyNonBuildReviewDeviation.ProjectSiteID
FROM
DailyNonBuildReviewDeviation
LEFT JOIN
NextDayNonBuildPlan ON DailyNonBuildReviewDeviation.NextDayNonBuildPlanID = NextDayNonBuildPlan.NextDayNonBuildPlanID
LEFT JOIN
[DailyNonBuildReport] ON DailyNonBuildReviewDeviation.DailyNonBuildReportID = DailyNonBuildReport.DailyNonBuildReportID
INNER JOIN
ProjectSites ON ProjectSites.ProjectSiteID = DailyNonBuildReviewDeviation.ProjectSiteID
WHERE
[DayOFDeviation] BETWEEN CONVERT(date, @FromDate) AND CONVERT(date, @EndDate))AA
GROUP BY
ProjectSiteName, ProjectSiteID, JobHead,
MeasurementPlanned, MeasurementReport, Deviation
END