Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

T-SQL formating data

I have a nvarchar field called Grade1 and the value is 360.. I need the value to be 400 based on a 10% markup and rounded to the nearest 5.. The next number is 385 and I need that to be 425 and so on.. Do I do something like this select round(grade1*.1),1)?
0
cheryl9063
Asked:
cheryl9063
  • 3
1 Solution
 
cheryl9063Author Commented:
I tried the below but got this error


Arithmetic overflow error converting nvarchar to data type numeric.
((((uph_Grade4) * .1)+4.9)/5)*.1

Open in new window

0
 
wdosanjosCommented:
Please try:

ceiling((cast(uph_Grade4 as int) * 1.1) / 5) * 5

Open in new window

0
 
cheryl9063Author Commented:
it's now displaying 0
0
 
cheryl9063Author Commented:
Sorry.. I was wrong that worked!! Thanks!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now