Increase in price, yearly.. and calculate the difference between the years.

Hi everyone
I need to make the following code show how many years it took for it to reach its required goal.
show difference between the years and how much money increased ever year. ..
I am totally confused at the moment... any help would be greatly appreciated...
declare
a number(9):=1000;
b number(9);
c number(9);
d number(9);
begin
for d in 2012..2099
loop
dbms_output.put_line(a||' '||d);
if a >2000 then
exit;
end if;
a :=a + a*10/100;
end loop;
end;
Result for above query:
Price Years
1000 2012
1100 2013
1200 2014 etc...
I need to show the amount of years it took to reach its goal, which was $2000
and also the change in price, how much it increased every year...
Thanks
Umair

Hi Umair ,
I am not sure why you have created so many different variables. ( b , c , d )
Try this
declare
    a                number(9)  :=1000;
    cnt              number      := 0;
begin
    for d in 2012..2099 loop
        if a > 2000 then    
            exit;
        end if;
        dbms_output.put_line(a||'   '||d);
        a :=a + a*10/100;
        cnt := cnt + 1;
    end loop;
    dbms_output.put_line( 'Number of years required to reach the goal are:- ' || to_number(cnt) );
end;
/If you want to show number of years in yyyy way ( example :- 2020) then set cnt to 2012 as for loop is starting with 2012.
Thanks.

Similar Messages

  • Major and minor Functional difference between 4.6c and ecc 6 in SD module

    Hi Gurus,
    Will anyone will mail me doc or url that shows the Major and minor Functional difference between 4.6c and ecc 6 in SD module.  Mail me at [email protected]
      full points for helpful answer
      Regards,
    PV

    Hi,
    This website is very helpfull for version comparision, have a look at it.
    <a href="http://solutionbrowser.erp.sap.fmpmedia.com/">Compare_Versions</a>
    Cheers...
    Santosh

  • How to read time stamps from a spreadshee​t and calculate the difference between consecutiv​e time stamps?

    Hi,
    I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
    Time Stamp                    Power Output
    11:00:00 AM                       3kW
    11:00:02 AM                       2.9kW
    11:00:04 AM                       3.2kW
    11:00:06 AM                       3.1kW
    The above data doesn't make any sense, but it is just for the purpose of this question.
    So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that

    Hello
    you can simple subtract one time from the other one and so you get the difference. -> Example
    Mike
    Attachments:
    Unbenannt 2.vi ‏8 KB

  • How to read time stamps from a spreadsheet and calculate the difference between consecutive time stamps?

    Hi,
    I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
    Time Stamp                    Power Output
    11:00:00 AM                       3kW
    11:00:02 AM                       2.9kW
    11:00:04 AM                       3.2kW
    11:00:06 AM                       3.1kW
    The above data doesn't make any sense, but it is just for the purpose of this question.
    So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that is sent. Then I have to

    Repeated forum post
    Please view http://forums.ni.com/ni/board/message?board.id=170&message.id=294435
    Regards,
    Juan Galindo
    Applications Engineer
    National Instruments

  • IPhone is locked and calculates the cloud account is not me I do not know how it appeared to me please help

    وتخوض فون ويحسب حساب سحابة ليس لي أنا لا أعرف كيف يبدو لي الرجاء المساعدة
    MEID: 99000271119547
    IMEI: 99000271119547743
    ICCID: 89966328121152577743

    '''Courtesy Helper7677'''
    This is from a good looking answer to a similar question, from the Search Firefox Help box at the top of this page -
    <<You have an item installed that is considered malware/spyware/adware.
    This type of pest is usually installed along with software you download from the internet; generally free programs, but not always. Carefully watch for "extra" items that will be installed and un-check or opt-out of them.
    You can check to see if you have any of these from Web Products" installed:
    Control Panel > Add or Remove Programs, click on any that you find and click "Remove": Ask.com Bar, My Search Bar, MyWay Speed Bar, My Web Search Bar, Fun Web Products Easy Installer
    See:
    http://www.safer-networking.com/removemywebsearch.php
    PC Hell: My Web Search Removal Instructions
    http://helpint.mywebsearch.com/intlinfo/help/toolhelp.jhtml#q3
    Also see: http://kb.mozillazine.org/Uninstalling_toolbars
    You MAY need to change a preference if when typing one or two words in the URL/Location/Address Bar sends you to some search page other than the one you expect. To reset your default URL/location bar search provider:
    Enter about:config in the address/URL bar and press the Enter key
    If you see a warning, accept it (Promise that you will be careful)
    Filter = keyword.URL
    Below the Filter, if keyword.URL is bold, right-click on keyword.URL and choose "Reset"
    Restart Firefox (File > Restart Firefox)
    See: http://kb.mozillazine.org/Keyword.url >>

  • Calculate date difference between overlapping periods

    hello folks,
    i am learning my way into more complex problem of java.
    i have to calculate the true period lenght for a set of periods.
    it is a little complidated to explain the whole business rules on this subject, but on a nutshell:
    we have teams that are give a single day payment for staying in a hotel, but since this team is composed of many people (?this is a team); there are days when more then one person stays in a hotel.
    we get these details at the end of a business event when all information is entered on our business intelligence system.
    for a given hotel stay, the following details are submitted:
    start date
    end date
    number of days in economic accomodation (lower class)
    number of days in luxure accomodation (higher class)
    if no number of days in any class, or the number is smaller then lower class is assumed to be the one used
    another business rule says that for the first night out (away from their home) staff receives an extra night for their transfer (!generous company!)
    i have created a class for holding all this information so far - HotelStay.java
    since this is a team information for a given business event i receive anything between 0 to 200 hotel stays.
    thus my dataset looks like
    teamID
    hotelStayStartDt
    hotelStayEndDt
    daysInLowerClass
    daysInHigherClass
    my objective are:
    to be able to calculate the actual number of stays (including any additions for the first day away)
    to be able to calculate number of total days - including over laps - these will be paid in a different rate)
    number of days in each hotel class - lower and higher
    since i am clueless how to go about it, i would really appreciate assistance here.
    below is my HotelStay.java
    many thanks,
    Nic

    here is the class that i have created so far
    package businessCalculations.awayStays;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import com.sun.org.apache.xalan.internal.xsltc.trax.SmartTransformerFactoryImpl;
    import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor.SetterOnlyReflection;
    * @author
    public class HotelStay {
         * hotel starting date of stay hotel stays can only start in the past or
         * today as this is not processing future bookings only dates over and above
         * 1990 are considered into this system
        private Date hotelStayStartDt;
         * hotel date end of staying only dates over and above 1990 are considered
         * into this system
        private Date hotelStayEndDt;
         * days for which a person stayed in economic or other lower class
         * accommodation
        private int daysInLowerClass = 0;
         * days for which a person stayed in de-luxe or other higher class
         * accommodation
        private int daysInHigherClass = 0;
         * flags when person was sleeping in another hotel at the beginning of this
         * stay (they went from one hotel to another without going home in betwee
         * if they were they do not receive the added day bonus for transfer
         * (one overnight stay <b>EXTRA</b>) thus if at the beginning of the stay,
         * they were not sleeping in another hotel, they receive an extra night for
         * their transfer
        private boolean isSleepingAwayOverlapping = false;
         * default constructor
         * @param hotelStayStartDt
         * @param hotelStayEndDt
         * @param daysInLowerClass
         * @param daysInHigherClass
        public HotelStay(Date hotelStayStartDt, Date hotelStayEndDt,
             int daysInLowerClass, int daysInHigherClass) {
         boolean outcome = this.addNewHotelStay(hotelStayStartDt, hotelStayEndDt, daysInLowerClass, daysInHigherClass);
         * @param hotelStayStartDt
         * @param hotelStayEndDt
         * @param daysInLowerClass
         * @param daysInHigherClass
         * @return
        public boolean addNewHotelStay(Date hotelStayStartDt, Date hotelStayEndDt, int daysInLowerClass, int daysInHigherClass) {
         if (this.isValidStayDt(hotelStayStartDt) && this.isValidStayDt(hotelStayEndDt)){
             int lengthOfStay = this.getLengthOfStay(hotelStayStartDt, hotelStayEndDt);
             if(lengthOfStay >=1) {
             this.setHotelStayStartDt(hotelStayStartDt);
             this.setHotelStayEndDt(hotelStayEndDt);
             if (
                  (daysInHigherClass + daysInLowerClass == 0)
              ||  (daysInHigherClass + daysInLowerClass <= lengthOfStay + 1 )
              this.setDaysInLowerClass(daysInLowerClass);
              this.setDaysInHigherClass(daysInHigherClass);
             } else {
              this.setDaysInLowerClass(daysInLowerClass);
              this.setDaysInHigherClass(daysInHigherClass);
             return true;
         }else{
             return false;
         * @return the admissionDt
        private Date getHotelStayStartDt() {
         return this.hotelStayStartDt;
         * @param admissionDt
         *            the admissionDt to set
        private void setHotelStayStartDt(Date admissionDt) {
         this.hotelStayStartDt = admissionDt;
         * @return the dischargeDt
        private Date getHotelStayEndDt() {
         return this.hotelStayEndDt;
         * @param dischargeDt
         *            the dischargeDt to set
        private void setHotelStayEndDt(Date dischargeDt) {
         this.hotelStayEndDt = dischargeDt;
         * @return the isOverlappingOtherCcStays
        private boolean isOverlappingOtherCcStays() {
         return this.isSleepingAwayOverlapping;
         * @param isOverlappingOtherCcStays
         *            the isOverlappingOtherCcStays to set
        private void setOverlappingOtherCcStays(boolean isOverlappingOtherCcStays) {
         this.isSleepingAwayOverlapping = isOverlappingOtherCcStays;
         * @return the daysInLowerClass
        private int getDaysInLowerClass() {
         return this.daysInLowerClass;
         * @param daysInLowerClass
         *            the daysInLowerClass to set
        private void setDaysInLowerClass(int daysInLowerClass) {
         this.daysInLowerClass = daysInLowerClass;
         * @return the daysInHigherClass
        private int getDaysInHigherClass() {
         return this.daysInHigherClass;
         * @param daysInHigherClass
         *            the daysInHigherClass to set
        private void setDaysInHigherClass(int daysInHigherClass) {
         this.daysInHigherClass = daysInHigherClass;
         * @return the isSleepingAwayOverlapping
        private boolean isSleepingAwayOverlapping() {
         return this.isSleepingAwayOverlapping;
         * @param isSleepingAwayOverlapping
         *            the isSleepingAwayOverlapping to set
        private void setSleepingAwayOverlapping(boolean isSleepingAwayOverlapping) {
         this.isSleepingAwayOverlapping = isSleepingAwayOverlapping;
        @Override
        public String toString() {
         String rtn = "";
         SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy hh:mm");
         String inDt = sdf.format(getHotelStayStartDt());
         String outDt = sdf.format(getHotelStayEndDt());
         rtn = "ArrivalDt("
             + (inDt.isEmpty() ? "" : inDt) + ")\t,BookOutDt("
              + (outDt.isEmpty() ? "" : outDt) + ")\t,DaysInLowerClass ("
              + String.valueOf(getDaysInLowerClass())
              + ")\t,DaysInHigerClass ("
              + String.valueOf(getDaysInHigherClass()) + ")";
         return rtn;
        public int getLengthOfStay(Date hotelStayStartDt, Date hotelStayEndDt ){
         Calendar startDt = new GregorianCalendar();
         startDt.setTime(hotelStayStartDt);
         Calendar endDt = new GregorianCalendar();
         endDt.setTime(hotelStayEndDt);
         long startMill = startDt.getTimeInMillis();
         long endMill = endDt.getTimeInMillis();
         // Calculate difference in days
         // divided by (24 hours, 60 minutes, 60 seconds, 1000 milliseconds
         // casted as (int)
         return (int) ((endMill - startMill) / (24 * 60 * 60 * 1000));
        private boolean isValidStayDt(Date aDate) {
         SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy");
         Calendar minDt = new GregorianCalendar();
         Calendar maxDt = new GregorianCalendar();
         maxDt.add(Calendar.DATE, +1);
         try {
             minDt.setTime(sdf.parse("01/jan/1990"));
         } catch (ParseException e) {
             e.printStackTrace();
         if (aDate.after(minDt.getTime()) && aDate.before(maxDt.getTime())) {
             return true;
         } else {
             return false;
    }Edited by: www.jegue.net on Jul 17, 2010 11:31 AM

  • Different price online and at the store

    I was going to pick up a Pandigital Super Nova tonight at the Greensboro, NC store, where they were onsale for $179.  They were sold out, and it was about closing time, so the associate suggested I order online.  The problem is, online, they list for $199.  Was the $179 price just for that store?

    Hello AverageJoe76,
    Thanks for shopping with us.  Our website will indeed match our in store price on regular sale items. It's pretty rare for these prices to differ, but when they do, you need to just give us a call a 1-888(BESTBUY) for help getting the price adjustment. Keep in mind that we need to price match while the sale price is active.  For full details, visit the link below.
    Best BUy Price Match Guarantee
    I hope this helps.  Happy shopping!
    Douglas|Social Media Specialist | Best Buy® Corporate
     Private Message

  • How to convert column to row in 10g  and calculate the count

    876602 wrote:
    Hi ,
    i need to convert the column to row in my DB 10g , i cant use the Decode method because i have about 2000 items in MDN column
    this is sample of my date ,
    MDN             Date
    5C4CA98EABA3     20111205235240
    5C4CA98EABA3     20110925121833
    5C4CA98EABB0     20111025103700
    5C4CA98EABB0     20111124103700
    5C4CA98EABB5     20111030175717
    5C4CA98EABB8     20110925142653
    5C4CA98EABB8     20111126175853i need the result to be ,
    MDN             Date                                   count
    5C4CA98EABA3     20111205235240 ;  20110925121833    2
    5C4CA98EABB0     20111025103700 ;  20111124103700    2
    5C4CA98EABB5    20111030175717                      1
    5C4CA98EABB8   20110925142653 ; 20111126175853       2any help please ,
    Edited by: 876602 on 15/12/2011 01:33 ص

    SQL> with t as
      2  (
      3  select '5C4CA98EABA3' MDN ,'20111205235240' Dte  from dual
      4  union all
      5  select '5C4CA98EABA3','20110925121833' from dual
      6  union all
      7  select '5C4CA98EABB0','20111025103700' from dual
      8  union all
      9  select '5C4CA98EABB0','20111124103700' from dual
    10  union all
    11  select '5C4CA98EABB5','20111030175717' from dual
    12  union all
    13  select '5C4CA98EABB8','20110925142653' from dual
    14  union all
    15  select '5C4CA98EABB8','20111126175853' from dual
    16  )
    17  select mdn,ltrim(sys_connect_by_path(dte,';'),';') s,rw as "count"
    18  from
    19  (
    20  select mdn,dte,row_number() over(partition by mdn order by mdn) rw
    21  from t
    22  )
    23  where connect_by_isleaf = 1
    24  start with rw = 1
    25  connect by prior rw = rw-1
    26  and prior mdn = mdn
    27  ;
    MDN          S                                                                                     count
    5C4CA98EABA3 20111205235240;20110925121833                                                             2
    5C4CA98EABB0 20111025103700;20111124103700                                                             2
    5C4CA98EABB5 20111030175717                                                                            1
    5C4CA98EABB8 20110925142653;20111126175853                                                             2

  • Format and Partitoin Disk - Difference Between Running TS/LiteTouch.vbs from Desktop Vs. Bootable Flash Drive.

    Hello,
    I have a question about disk formatting. If run our TS from the Run box, the HD is not cleaned. The image will be applied successfully but if there were any extra partitions, HP Recovery partitions for example, they will still be present.
    If run the same TS form a bootable USB drive, the HD is completely erased.
    Can anyone explain the difference in running the TS from the Desktop/Run box vs. running it from a bootable drive?
    Thanks.

    From LiteTouch.log, the DeploymentType is NEWCOMPUTER when run off the flash drive but REFRESH when run from the desktop. LT must detect that its running in an OS and decides not to clean the drive. We do not have DeploymentType set in our
    rules.
    Ah, glad you found it. That's what I was going to suggest, based on what environment the TS runs from.
    -Nick O.

  • How to calculate the difference between values in a custom PSObject?

    If I have a PSObject (created from an imported CSV) that has data like the following:
    date,Total size of files uploaded
    03-17-2014 09:08,1293334574547
    03-17-2014 09:10,1293335326912
    03-17-2014 09:13,1293336523562
    03-17-2014 09:14,1293337541156
    03-17-2014 09:16,1321031223511
    03-17-2014 09:16,1321032156844
    This CSV will have lines added to it, so the total number of lines will vary.
    Is there a way that two most recently added values and calculate the difference of the "Total size of files uploaded" values? 
    I have the columns properly cast as datetime and
    int64 already using this:
    $csv = Import-Csv $csvLocation |
    Where-Object { ![string]::IsNullOrWhiteSpace($_.datetime) } |
    Foreach-Object {
    $_.datetime = $_.datetime -as [datetime]
    $_."Total size of files uploaded" = $_."Total size of files uploaded" -as [int64]
    $_ }
     I tried searching thinking surely there must be someone else who has tried to do this" but I cannot find anything. I am just not sure how to approach this problem. Any help would be appreciated!

    Assuming all of your records are sequential with the last two being the most recent you could use this:
    $csv = Import-Csv $csvLocation |
    Where-Object { ![string]::IsNullOrWhiteSpace($_.datetime) } | select -last 2
    Foreach-Object {
    $_.datetime = $_.datetime -as [datetime]
    $_."Total size of files uploaded" = $_."Total size of files uploaded" -as [int64]
    $_ }
    $Difference = $csv[1]."Total size of files uploaded" - $csv[0]."Total size of files uploaded"
    This uses the index of the imported array and just the last two records.  Note that this will give a negative value if the total is less in the later record.  Hope this helps!
    You could also use 
    | sort datetime -ascending | select -last 2
    if they aren't already in order...

  • Oscillating amplidude waveform to be smoothed out, and calculate frequency of difference of original waveform

    a steep impulse of oscillating amplitude, i need to smooth out the waveform and calculate the frequency of difference of original waveform and smoothed waveform how to do this?
    i have tried to do with calculating moving average of the data points.
    i have attached the data points here with.
    Attachments:
    CASE03.DOC ‏1 KB

    Hello,
    I was not able to open the MS Word DOC attached to your post, so I am not exactly clear what your dataset looks like. When you say you have an oscillating input that is an impulse, do you mean that the waveform contains discrete jumps? If so how would you like to smooth the waveform?
    Can you please post two graphs, or two sets of datapoints which describe your input and output? By looking at exactly how a specific input should be translated to a specific output we should be able to give you a much more specific answer.
    Scott Y
    NI

  • How can I calculate the slope of an isometric torque curve with a trigger and time increments of 0-30ms, 0-50ms, 0-100ms etc....

    I am analyzing isometric muscle contractions of the quadriceps and want to calculate the rate of force development (not just peak torque) for the torque-time curve.  I want to set a trigger so that the slope of the torque curve is calculated when 7 newton-meters is reached.  From there I'm trying to calculate the slope in time increments of 0-30ms, 0-50ms, 0-100ms, etc....My data is sampled at 2000 Hz and written in text files.  Below is a copy of the VI I have developed so far.  I am very new to programming with LabVIEW but can definitely see its potential!  Any advice would be greatly appreciated. 
    Attachments:
    Dissertation Isometric RFD.vi ‏14 KB

    Fiddler918,
    When trying to implement something like this in LabVIEW, it is often helpful to think about how you would program this function in a traditional text-based language.  Try and break the problem down.  You need to locate the data point in your array that is 7 Nm or greater.  At this point, you will need to grab the data points that are 60 indices (for the 30ms gap, assuming your points are equally spaced 0.5 ms apart), 100 indices (for the 50 ms gap), and 200 indices (for the 100ms gap) ahead of this point in your data file, and calculate the slope using pairs of data points.  
    Here is a general description of a possible implementation of this code:
    You can wire the appropriate column of the data array into a For Loop on the block diagram and have it auto index through the points.  If you right click on the Use the Greater or Equal? function to generate a Boolean that will be true when you want to exit the For Loop.  Right-click on the border of the For Loop and select Conditional Terminal.  This will cause a small stop sign to appear.  If you wire the Boolean to the conditional terminal, the loop will stop at the value that is greater than or equal to 7 Nm.  If you wire the Loop Iteration terminal out of the For Loop to the right, this will give you the index of the value in the column that you’re interested in.  Having this value, you can then use the Array functions to grab the specific data points you need, and numeric functions to perform the necessary math.
    If any of this didn't make sense, the LabVIEW help files are a great resource to use.
    Here is a link to some video tutorials of the LabVIEW programming environment.  They may help you in the development of your code.
    http://www.ni.com/academic/students/learnlabview/
    Regards,
    Jared R.
    Precision DC Product Support Engineer
    National Instruments

  • What is the Differences between Caingorm2 and Parsley(Caingorm3) ? Very Urgent ...plz help me out..

    Hi all,
            I am familier with caingorm 2 , and i am new to parsley , can any one give  differences between caingorm2 and parsley(caingorm3) ?
    and also please
    1)how to create a BeanConfig.mxml configuration  file in parsly ? how many ways we can inject beans in BeanConfig.mxml
    2)and how the event dispatched in parsly and handled by parsley step-by step?
    3)please explain by taking a small example insert usename and password in to data base using LCDS ?
    thanks
    -Balu

    Hi
    You can refer the following links for your question.
    Difference between AET and EEWB
    What is the use of AET? What are the differences between AET and EEWB?
    Difference between EEWB - UI Configuration Tool - AET
    http://senthilsapcrm.wordpress.com/2010/02/04/adding-custom-fields-in-sap-crm-7-0-using-aet/
    What is the main difference between eewb and aet tool ?
    Hope it is useful.
    Thanks and regards
    Preeti Viswanath

  • What is the use of AET? What are the differences between AET and EEWB?

    Hi,
    I would like to know about AET? What is the use of AET? What are the differences between AET and EEWB? Please help me out?
    Thanks,
    Satish

    Hi
    You can refer the following links for your question.
    Difference between AET and EEWB
    What is the use of AET? What are the differences between AET and EEWB?
    Difference between EEWB - UI Configuration Tool - AET
    http://senthilsapcrm.wordpress.com/2010/02/04/adding-custom-fields-in-sap-crm-7-0-using-aet/
    What is the main difference between eewb and aet tool ?
    Hope it is useful.
    Thanks and regards
    Preeti Viswanath

  • Item and uom not on price list and unable to book the order

    Hi,
    Actually while trying to create a sales order using 'Order Import', facing the below issue and the List Price in the Line Item is NULL.
    This is preventing the order from being booked.
    ITEM<902986> and UOM<PT> not on US CONSOLIDATED PRICE LIST<Price List>.
    The Item is present in the Price list and also the dates are well in past.
    Not sure if this a setup issue or issue with the interface program.
    Please help me in resolving this issue.
    Thanks in Advance.
    Regards,
    Vamsee

    Check UOM for this part in pricelist.

Maybe you are looking for