lundi 27 avril 2020

If / While Loop / Case Statement will not work @FullWeek in bold is throughing an error saying expecting ( or Select

If (Hoursweek > @FullWeek ) BEGIN WHILE PunchDate < '@Date BEGIN IF (@FullWeek - (Hoursweek +@Total)) < @FullWeek BEGIN (@FullWeek - (Hoursweek +@Total)) = @Total END IF (@FullWeek - (Hoursweek +@Total)) > @FullWeek BEGIN ((@FullWeek + @TotalHours) - (Hoursweek +@Total)) = @Total

                       CASE 
                            WHEN PunchDate = @StartDate THEN @TotalHours +Day1
                            WHEN PunchDate = @StartDate THEN @TotalHours +Day2
                            WHEN PunchDate = @StartDate THEN @TotalHours +Day3
                       END
                  END
          END

END

Aucun commentaire:

Enregistrer un commentaire