January 30, 2014 at 4:32 pm
If Statement is not working
IF (@max-@min)>290
BEGIN
SELECT @col3 = SUM(Latin) FROM allcount;
DELETE FROM allcount;
INSERT INTO allcount (datetime, Latin) VALUES (@datetime,@col3);
END;
END;
January 30, 2014 at 4:42 pm
Here is my whole program. Before the If works fine.
CREATE PROCEDURE [IncCondense] (@datetime DATETIME, @latin INT) AS
DECLARE @max-2 INT, @min-2 INT, @col3 INT;
INSERT INTO allcount (datetime,Latin) VALUES (@datetime,@latin)
SELECT @min-2=MIN(ida), @max-2=MAX(ida) FROM allcount;
IF (@max-@min)>290
BEGIN
SELECT @col3 = SUM(Latin) FROM allcount;
DELETE FROM allcount;
INSERT INTO allcount (datetime, Latin) VALUES (@datetime,@col3);
END;
END;
GO
January 30, 2014 at 4:59 pm
January 30, 2014 at 5:07 pm
I took out one end; and it still does not work.
January 30, 2014 at 5:11 pm
Define "does not work". Are you getting an error? What should it do and it's not doing? Or what is it doing that it shouldn't?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply