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
 General SQL Server Forums
 New to SQL Server Programming
 CONVERT
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

divan
Posting Yak Master

153 Posts

Posted - 09/25/2012 :  09:14:43  Show Profile  Reply with Quote
I have the following script lines and I am getting the following error message..

"The round function requires 2 to 3 arguments."

SELECT

REG_PROC_PREM AS REG_PROC_PREM,
CONVERT (DECIMAL (10,0),ROUND((COALESCE(BASE_PREM,0)+ COALESCE(PHYS_TMB_PREM,0))


*(1.0+COALESCE(GROUP_DISC,0)/100.0)
*(1.0+COALESCE(DISCOUNT_2,0)/100.0)
*(1.0+COALESCE(EXPER_DISC,0)/100.0)
*(1.0+COALESCE(RISK_MGMT,0)/100.0)
*(1.0+COALESCE(DISCOUNT_1,0)/100.0)
*(1.0+COALESCE(DISCOUNT_3,0)/100.0)
*(1.0+COALESCE(MANUAL_BLENDING,0)/100.0)
*(1.0+COALESCE(PART_TIME_DISC,0)/100.0)
*(1.0+COALESCE(NEW_PRAC_DISC,0)/100.0)
*(1.0+COALESCE(CLAIMS_MADE_DEBIT,0)/100.0)
*(1.0+COALESCE(TAIL_NOT_BOUGHT,0)/100.0)
*(1.0+COALESCE(GRIEVANCE,0)/100.0)
*(1.0+COALESCE(FELONY_MISDEMEANOR,0)/100.0)
*(1.0+COALESCE(SICK,0)/100.0)
*(1.0+COALESCE(REVIEW,0)/100.0)
*(1.0+COALESCE(NEW_PRACTICE,0)/100.0)
*(1.0+COALESCE(PART_TIME,0)/100.0)
*(1.0+COALESCE(ABUSE,0)/100.0)
*(1.0+COALESCE(LICENSE,0)/100.0)
*(1.0+COALESCE(MISCONDUCT,0)/100.0)
*(1.0+COALESCE(RELAPSE,0)/100.0)
*(1.0+COALESCE(NO_COVERAGE,0)/100.0)
*(1.0+COALESCE(FDA_APPROVED,0)/100.0)
*(1.0+COALESCE(EXPIRING_COVERAGE,0)/100.0)
*(1.0+COALESCE(IMP_PHYS_PROG,0)/100.0)
*(1.0+COALESCE(NOT_RENEWED,0)/100.0)
*(1.0+COALESCE(OTHER_DEBIT,0)/100.0)
*(1.0+COALESCE(OTHER_CREDIT,0)/100.0)
*(1.0+COALESCE(LOSS_FREQUENCY,0)/100.0)
*(1.0+COALESCE(LONGEVITY_CREDIT,0)/100.0)
*(1.0+COALESCE(VIC_LIAB_DEBIT,0)/100.0)
*(1.0+COALESCE(MISC_DEBIT_1,0)/100.0)
*(1.0+COALESCE(MISC_DEBIT_2,0)/100.0)
+ COALESCE (REG_PROC_PREM,0)) AS EXPR_PREM

bandi
Flowing Fount of Yak Knowledge

India
2223 Posts

Posted - 09/25/2012 :  09:21:03  Show Profile  Reply with Quote
Hi,


REG_PROC_PREM AS REG_PROC_PREM,
CONVERT (DECIMAL (10,0),ROUND((COALESCE(BASE_PREM,0)+ COALESCE(PHYS_TMB_PREM,0), 0 )


--
Chandu
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/25/2012 :  09:22:42  Show Profile  Reply with Quote
Since you are converting the result to decimal using CONVERT (which will round the parameter passed to it), you don't really need the ROUND function. So change it to this:
SELECT 

REG_PROC_PREM AS REG_PROC_PREM,
CONVERT (DECIMAL (10,0),(COALESCE(BASE_PREM,0)+ COALESCE(PHYS_TMB_PREM,0))

....
If you do want to use round, add another parameter (towards the end) which tells the round function how many digits to round to.
....
*(1.0+COALESCE(MISC_DEBIT_1,0)/100.0)
*(1.0+COALESCE(MISC_DEBIT_2,0)/100.0)
+ COALESCE (REG_PROC_PREM,0),0)) AS EXPR_PREM
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2223 Posts

Posted - 09/25/2012 :  09:24:16  Show Profile  Reply with Quote
quote:
Originally posted by sunitabeck

Since you are converting the result to decimal using CONVERT (which will round the parameter passed to it), you don't really need the ROUND function. So change it to this:
SELECT 

REG_PROC_PREM AS REG_PROC_PREM,
CONVERT (DECIMAL (10,0),(COALESCE(BASE_PREM,0)+ COALESCE(PHYS_TMB_PREM,0))

....
If you do want to use round, add another parameter (towards the end) which tells the round function how many digits to round to.
....
*(1.0+COALESCE(MISC_DEBIT_1,0)/100.0)
*(1.0+COALESCE(MISC_DEBIT_2,0)/100.0)
+ COALESCE (REG_PROC_PREM,0),0)) AS EXPR_PREM




yeah am sry...... yours is correct

--
Chandu
Go to Top of Page

divan
Posting Yak Master

153 Posts

Posted - 09/25/2012 :  09:47:57  Show Profile  Reply with Quote
Thanks everyone it worked like a charm!!!!! Have a great day where ever you are....
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.06 seconds. Powered By: Snitz Forums 2000