Solved

T-SQL formating data

Posted on 2011-09-28
4
246 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now