|
| I am trying to create functions in Sybase 7 and I am having no luck.
I have tried different versions of the code below and I get errors each
time I run the script.
The error I get for the one below occurs on line 27 column 4
ASA Error -131: Syntax error near ('end of line')
Here is the function that I am trying to create in Sybase 7.
CREATE FUNCTION fnJobCostProjection(
@Budgeted decimal(16,2),
@Expended decimal(16,2),
@Subcontracted decimal(16,2),
@ManualProjection decimal(16,2),
@ManualFlag char(1),
@SubVendor char(7),
@PctComplete decimal(7,4))
RETURNS decimal(16,2)
BEGIN
DECLARE @Amt decimal(16,2);
IF @ManualFlag = 'Y' THEN
SET @Amt = @ManualProjection
ELSE
IF @SubVendor <> '' THEN
SET @Amt = @Subcontracted
ELSE
IF @PctComplete > 0 THEN
SET @Amt =
@Expended / (@PctComplete / 100)
ELSE
IF @Budgeted > @Expended THEN
SET @Amt = @Budgeted
ELSE
SET @Amt = @Expended;
RETURN(@Amt);
GO;
Does anyone have any suggestions?
|
|