SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 An insufficient number of arguments were supplied
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

abdbari
Starting Member

Malaysia
7 Posts

Posted - 03/28/2013 :  00:14:27  Show Profile  Reply with Quote
i got the error :Kindly assist.

An insufficient number of arguments were supplied for the procedure or function dbo.findEmployerPercentage


The script as below:
alter function findEmployerPercentage(@joindt datetime, @salary numeric)
RETURNS numeric(2)
as
begin
DECLARE @percent varchar(255)

if datediff(Day,current_timestamp, DATEADD(Year, 2, @joindt)) <= 0
Begin
set @percent = 15.00000000
END
ELSE
BEGIN
if @salary <= 5000
begin
set @percent = 13.00000000
end
else
begin
set @percent = 12.00000000
end
END
RETURN @percent
END

Edited by - abdbari on 03/28/2013 00:15:13

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 03/28/2013 :  02:54:54  Show Profile  Visit russell's Homepage  Reply with Quote
Make sure when calling it that you're passing both @joindt and @salary
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17642 Posts

Posted - 03/28/2013 :  04:39:51  Show Profile  Reply with Quote
quote:
i got the error :Kindly assist.

An insufficient number of arguments were supplied for the procedure or function dbo.findEmployerPercentage

Show us your query

Also why are you declaring @percent as varchar ? when you are storing numeric into it ?


KH
Time is always against us

Go to Top of Page

abdbari
Starting Member

Malaysia
7 Posts

Posted - 03/28/2013 :  05:00:08  Show Profile  Reply with Quote
OK now.tq
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000