473,320 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Newbie is stuck! How do I increase a cost by a percentage?

Hi - currently training on SQL - doing alright so far until this sub-question...

Migrate all data from the JOB_COST table into the TOTAL_COST table. For those records that match the COST_ID, update the UPPER_LEVEL and increase the cost by 15%, otherwise insert the records.

...I've looked everywhere online but have no luck. How do I increase a cost by a percentage? Please?
Aug 7 '08 #1
2 1647
Atli
5,058 Expert 4TB
Hi.

Basic math... you multiply by 1.15 ;)
Expand|Select|Wrap|Line Numbers
  1. SELECT numericField * 1.15
  2.  
Should return the values of that field + 15%;

If you are getting any rounding issues (which you shouldn't), you can CAST it to Decimal
Expand|Select|Wrap|Line Numbers
  1. SELECT CAST(numericField AS Decimal) * 1.15
  2.  
Aug 7 '08 #2
Hi.

Basic math... you multiply by 1.15 ;)
Expand|Select|Wrap|Line Numbers
  1. SELECT numericField * 1.15
  2.  
Should return the values of that field + 15%;

If you are getting any rounding issues (which you shouldn't), you can CAST it to Decimal
Expand|Select|Wrap|Line Numbers
  1. SELECT CAST(numericField AS Decimal) * 1.15
  2.  
Duh! :-) There was me expecting something long and complicated!

Thanks Atli - much appreciated!
Aug 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: kathleen | last post by:
Hi there, I'm new to this forum & to programming in general, and am really stuck with a piece of buggy code. Can anyone help? I have several problems which may or may not be related. I have...
0
by: igmox | last post by:
hi, i am a complete newbie and got stuck. my question is about costumers and prices Customer_ID CustomerName CustomerType 1 John 2 2 Joe ...
2
by: Paul Revere | last post by:
Hi, all of you! I am new to this community. I am a web designer and a friend of mine and I have a server and manage websites (mostly ours but also a few clients). I manage the sites and he does...
1
by: bzbee | last post by:
Hello I ran across this site by accident & hope someone can help me. I know this sounds stupid .But I need to know how to type SCANREG in at Dos prompt. I know nothing about Dos prompt. I...
3
by: aplata | last post by:
I am trying to understand the following code: my @arr1=(5,3,2,1,4); my $i=0; my $j=0; $tmpnum for($i=0;$i<@arr1;$i++) { for($j=0;$j<@arr1;$j++) { if($arr1<$arr1) { ...
2
by: Zethex | last post by:
At the moment i'm doing a piece of work for school and I'm stuck at the moment. I have a list of words, for example: Sentence = I have another list which I need to use to replace certain...
2
by: nikosk | last post by:
I just spent a whole day trying to read an xml file and I got stuck with the following error: Exception Type: UnicodeEncodeError Exception Value: 'charmap' codec can't encode characters in...
44
by: Andy Dingley | last post by:
On 15 May, 04:55, Prisoner at War <prisoner_at_...@yahoo.comwrote: Or in another universe, where things are understood and site code is stable and reliable, beginners don't even think about...
2
by: James Calivar | last post by:
I'm a newbie trying to write a script that uses threads. I'm right now a little bit stuck in understanding why the code snippet I wrote doesn't seem to be entering the function defined in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.