Hello,
I am trying to help a friend who needs help in SQL 7.0. His current code is for SQL2000 and is using functions as below:
CREATE FUNCTION getgl (@ap_y nchar(1), @mot nchar(2), @cc nchar(2), @item nchar(3))
RETURNS nvarchar(15)
AS
BEGIN
DECLARE @MODE nvarchar(4)
DECLARE @GL nchar(13)
SET @MODE = CASE @mot when '40' then '0202' when '41' then '0202' else '0501' end
SELECT @GL =
CASE UPPER(@ap_y)
WHEN 'Y' THEN '4'+ @MODE + '0-' + @cc + @item
WHEN 'N' THEN '5'+ @MODE + '0-' + @cc + '-000'
ELSE '399999-00-000'
END
RETURN(@GL)
END
then trying to execute it using something like this:
INSERT INTO TransferCostT(blah,blah,blah)VALUES(dbo.getgl('N', '40', LEFT('3101',2), LEFT('0210',3)))
How would you get this to work in SQL 7.0? I do not know anything about SQL so I apologize if this is a stupid question. Just trying to help a friend. Thanks.
I am trying to help a friend who needs help in SQL 7.0. His current code is for SQL2000 and is using functions as below:
CREATE FUNCTION getgl (@ap_y nchar(1), @mot nchar(2), @cc nchar(2), @item nchar(3))
RETURNS nvarchar(15)
AS
BEGIN
DECLARE @MODE nvarchar(4)
DECLARE @GL nchar(13)
SET @MODE = CASE @mot when '40' then '0202' when '41' then '0202' else '0501' end
SELECT @GL =
CASE UPPER(@ap_y)
WHEN 'Y' THEN '4'+ @MODE + '0-' + @cc + @item
WHEN 'N' THEN '5'+ @MODE + '0-' + @cc + '-000'
ELSE '399999-00-000'
END
RETURN(@GL)
END
then trying to execute it using something like this:
INSERT INTO TransferCostT(blah,blah,blah)VALUES(dbo.getgl('N', '40', LEFT('3101',2), LEFT('0210',3)))
How would you get this to work in SQL 7.0? I do not know anything about SQL so I apologize if this is a stupid question. Just trying to help a friend. Thanks.