Assuming you're looking at the code from this article:
Create and Populate Date Dimension for Data Warehouse[
^]
The part of the code you're trying to execute includes the start of a loop:
WHILE @CurrentDate < @EndDate
BEGIN
but doesn't include the closing part of the loop:
SET @CurrentDate = DATEADD(DD, 1, @CurrentDate)
END
This will obviosuly produce the syntax error you saw:
Msg 102, Level 15, State 1, Line 88
Incorrect syntax near ')'.