Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

T-SQL formating data

Posted on 2011-09-28
4
250 Views
Last Modified: 2012-06-21
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
Comment
Question by:cheryl9063
  • 3
4 Comments
 
LVL 1

Author Comment

by:cheryl9063
ID: 36719873
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
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 36719967
Please try:

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

Open in new window

0
 
LVL 1

Author Comment

by:cheryl9063
ID: 36720010
it's now displaying 0
0
 
LVL 1

Author Comment

by:cheryl9063
ID: 36720045
Sorry.. I was wrong that worked!! Thanks!
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question