How to sum the amount

how can I add the amount shown below for year 1999. I would like to add all the amount between 01/22/1999 - 12/17/1999. thank you
here is my simple sql looks like
select sum(l.contamt),b.datelet
from bidlet b, letprop l
where b.LETTING = l.LETTING
and l.LETSTAT='A'
group by b.datelet
Here is my desired out put
Amount year
xxxxxx 1999
xxxxx 2000
xxxxxx 2001
24,692,441     01/22/1999 00:00:00
30,625,058     02/26/1999 00:00:00
810,879     03/16/1999 00:00:00
45,415,715     03/19/1999 00:00:00
34,359,502     04/09/1999 00:00:00
34,967,761     04/23/1999 00:00:00
1,396,831     05/04/1999 00:00:00
40,408,333     05/14/1999 00:00:00
37,556,062     05/28/1999 00:00:00
19,583,374     06/11/1999 00:00:00
45,105,742     06/25/1999 00:00:00
6,096,878     07/23/1999 00:00:00
369,439     08/17/1999 00:00:00
15,293,129     08/27/1999 00:00:00
9,249,995     09/10/1999 00:00:00
9,078,176     09/24/1999 00:00:00
2,153,323      10/22/1999 00:00:00
6,239,335     11/19/1999 00:00:00
26,908,007     12/17/1999 00:00:00

user452051 wrote:
how can I add the amount shown below for year 1999.You're very nearly there - all you need to do is convert your dates so they all represent just the year part - you can do this by using the TRUNC function to set the dates to the start of whatever year they belong to:
eg.
TRUNC(sysdate, 'yyyy')

Similar Messages

  • How to Sum the amounts for calculating rates.

    Hi,
    I have a requirement in Apps 11i (OAB) that I need to code in PL/SQL. I would be calling a procedure in order to complete this task. When an Extract is run, this code gets executed and should return the amount for that person.
    I need to calculate sum of all the amounts for each of the months between START date to the END date.
    Ex: Amount = Amount + (for each of the months between START and END date) x Rate.
    This START and END date would be calculated in the procedure itself.(dynamic).
    Once we get the START date and END date, we need to loop thru some records and find person's rate between those START date and END date.
    For rate calculation:
    15th day of any month is used as the cut off date for rate calculation.
    Suppose from 01-JAN-2006 to 15-MAR-2006 Rate is Rs 10 AND
    16-MAR-2006 to 01-JUL-2006 rate is Rs 20 AND person died on 01-JUL-2006
    Then rate = Rs(3x10) + Rs(3x20) + full month of July Rs.20 (P.S Here person's death needs to evaluated for the whole month) =30 + 60 + 20 = Rs.110
    Typically the start date and end date would be in one particular YEAR. And person may have different rates for different amounts as mentioned above.
    Let me if you need any more details..Thank You!
    Additional Info:
    This data comes from 2 tables in OAB Application where it can be joined with a common ID.
    One table lets say Coverage table contains the usual columns Eff_start_date, Eff_end_date along with this it has Coverage_start_date and Coverage_end_date (Dates specifying duration of the person enrolled in particular coverage.)
    P.S Rate Changes ONLY when the person enrolls in different coverage.
    2nd Table lets say Rate table contains the usual columns Eff_start_date, Eff_end_date along with this it has rate_start_date and rate_end_date and RATE(column) for that duration.(may vary depending upon the coverage).
    All the records should be between the START and END date, which will be calculated at runtime.
    Unable to submit any sample records.:-(
    Well, IF I had given the exact requirement, I would have got the solution by this Time!!! Your comments (and solutions) would definitely help me. Thank You
    Message was edited by:
    user559682

    If i understand you correctly it can be possible with :
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL>
    SQL> drop table dates;
    Table dropped
    SQL> create table dates( "start" date, "end" date, "rate" number);
    Table created
    SQL> insert into dates values( to_date('01.01.2006', 'DD.MM.YYYY'), to_date('30.05.2006', 'DD.MM.YYYY'), 10);
    1 row inserted
    SQL> insert into dates values( to_date('01.06.2006', 'DD.MM.YYYY'), to_date('15.09.2006', 'DD.MM.YYYY'), 15);
    1 row inserted
    SQL> insert into dates values( to_date('16.09.2006', 'DD.MM.YYYY'), to_date('31.12.2006', 'DD.MM.YYYY'), 20);
    1 row inserted
    SQL> SELECT * FROM dates;
    start       end               rate
    01.01.2006  30.05.2006          10
    01.06.2006  15.09.2006          15
    16.09.2006  31.12.2006          20
    SQL> SELECT t.i, d."rate"
      2    FROM (SELECT add_months(to_date('01.01.2006', 'DD.MM.YYYY') /* start*/, LEVEL - 1) i
      3            FROM dual
      4          CONNECT BY LEVEL <= 12) t
      5        ,dates d
      6   WHERE t.i BETWEEN d."start" AND d."end";
    I                 rate
    01.01.2006          10
    01.02.2006          10
    01.03.2006          10
    01.04.2006          10
    01.05.2006          10
    01.06.2006          15
    01.07.2006          15
    01.08.2006          15
    01.09.2006          15
    01.10.2006          20
    01.11.2006          20
    01.12.2006          20
    12 rows selected
    SQL> SELECT SUM(d."rate") rs
      2    FROM (SELECT add_months(to_date('01.01.2006', 'DD.MM.YYYY') /* start*/, LEVEL - 1) i
      3            FROM dual
      4          CONNECT BY LEVEL <= 1 +
      5                     extract(MONTH FROM to_date('10.10.2006', 'DD.MM.YYYY') /*death*/) -
      6                     extract(MONTH FROM to_date('01.01.2006', 'DD.MM.YYYY') /* start*/)
      7          ) t
      8        ,dates d
      9   WHERE t.i BETWEEN d."start" AND d."end";
            RS
           130
    SQL>

  • How to sum the column in a table seperated by sign.

    How to sum the column in a table separate by sign.
    For Example:
    A B
    10 MOHAN
    -15 KUMAR
    -25 MARCH
    50 MAY

    SELECT  SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
            SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
      FROM  tbl
    /SY.

  • How to get the amount of free physical memory?

    How to get the amount of free physical memory?
    (without sudo or root)

    vmstat will give it to you.
    Although the question depends a bit on what you mean by free memory.
    The figure vmstat labels free (in any reasonably recent version of solaris) actually represents memory mostly filled with cached file contents. So it represents memory that can be easily released if needed by something more important.
    Like most unix versions, solaris will use any free memory to cache files thats have been read/written previously just in case they are needed again

  • How to find the amount of free disk space on my pc....... in java of course

    how to find the amount of free disk space on my pc

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=free+disk+space&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums

  • How to know the amount of ora 11g page-out  memory (sga and pga)?

    How to know the amount of oracle 11g page-out memory ( sga and pga) in the SunSolaris 10 Unix and Linux.
    I need to know how many oracle memory are being page-out ( all and for a one oracle server process).
    thanks

    You can monitor the paging with vmstat or sar commands.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b32009/tuning.htm#sthref500
    You can also get the paging information on OEM home page if configured for your database.
    But I don't know if there exists a method with which one can find out how much memory per session/server process is getting paged out.

  • Any ideas on how to control the amount of sustain pedal data that Logic Pro 9 records? Every time I press the sustain pedal down, it records 4 sustains. Same thing when I release the pedal. Thanks!

    Any ideas on how to control the amount of sustain pedal data that Logic Pro 9 records? Every time I press the sustain pedal down, it records 4 sustains. Same thing when I release the pedal. Thanks!

    This gets confusing, you have two Macs with different issues and two pedals with different issues? First let's sort out what's what. So, do the issues come from the pedals or from the Mac software? To find out, simply switch the pedals and note their behaviour. No change: it's the software, change: it's the pedals (imho the most likely scenario).
    Second, what kind of pedals are they? Can you name the type of pedal too? The Yamaha what and the Mgear which?
    Third, with the 4 fold data problem, are the doubled events simultaneous, or a few ticks apart, or more?
    Also, you have no MIDI keyboard? Are the pedals both "standalone"?
    I think you have to sort this problem at its' source, which are the pedals. You could, if push really comes to shove, perhaps create some sort of ingeneous/elaborate transformer setup in the environment to filter the extra messages, although with the 4/4 sustain events that may not even be possible. With the "stepped" events you could set up a filter to just block all events with values 20-110 or so.
    But much better would be to configure the pedal(s) correctly.

  • How to avoid the Amount and Date values for VOID Cheques

    Hi All,
    I had created a two window i.e For Amount and Date. If I process the cheque the Amount value and Date should not trigger for VOID CHEQUES.
    Can any one tel me how to avoid the Amount and Date values for VOID Cheques
    Your help will be greatly appreciated.
    Regards
    Yathish

    Hi,
    I dont know which tablel you are referring to, is it PAYR table and the field VOIDR?
    If a cheque is voided, it would have a reason and it is stored in VOIDR field of this PAYR table.
    Check if the field VOIDR is filled, if it is filled, do not print the amount and date.
    Regards
    Subramanian

  • How to Sum the datafield of a sub-group?

    Post Author: [email protected]
    CA Forum: General
    Hello guys,
    I am having this issue that I want to only Sum the datafield at sub-group level, not the detail level. But when I do the sum, it is adding all the details. The reason I am having this is because I have somewhat duplicated details (they complement each other). I merge them using group (by Item). The Item QTY is the feild that they all have and they have the same value, but I only need one of them. Now I want to group them by order number and show the total of items I ordered. I Sum all the items' QTY, but instead of sum the QTY that's merged, it sums all the QTY from detail. Basically I am suming duplicate numbers.
    Is there any solution to this? Thank you.

    Post Author: [email protected]
    CA Forum: General
    Hello Jagan,
    Thank you for the help. I treid the Average running total, but the problem is that I cannot do Summary on those new fields on the parent group. Also I can't get rid of the dupliate because the singel record does not contain enough info, I need all the records to merge togather to collect all the required inforamtion. Before I will just created a merged view on my DB to get rid of duplicate records. But this time, I am linking too much tables (includes external server DB table) that I can't make a view for that.
    Basically I have an order that splits into multiple invoices that get shipped using an external server where the Actual Ship Date does not write back to our own ordering system. I am trying to see if all my items are ship on time. So I need to merge all the items QTY from invoices that linked with external shipping DB, and group them in one order.
    The main problem I have is that I can't do summary on many custome fields. I can made the correct amount using Formula Field that has a shared flag to not include duplicate numbers. But once I use the shared flag, the forumla is no longer useable by Summary.
    Anyway, I think I will just use Excel instead. I already have all the proper data, just that when I do group summary in Crystal, it becomes a problem. I will export the data and do analysis from there.
    Thank you for the help

  • How to read the amount of free memory available?

    I need a tool to tell me the amount of free memory left, at any given time. I want to tell my user in advance, and as the experiment proceeds, how much experiment time can remain before we will run out of memory. Yes I know, in a more perfect world the data would be written to disk and not stay in memory; but for now this solution would really help.
    Please be clear: I'm not looking for the performance profiling tool. I need something that will tell my program, at runtime, how much memory is left available to it. Is there any such tool?
    Thanks,
    Ken

    Hey Ken,
           I think this article discusses what you're looking for:
    How Can I Programmatically Find Information About My Computer's Memory Usage?
    http://digital.ni.com/public.nsf/allkb/B5889EB5349FAC478625723E00090265
    Hope this helps!
    --Ryan S.

  • How to limit the amount of disk space Time Machine will use?

    On Yosemite, how do you limit the amount of disk space Time Machine will use?
    I'm using a Seagate Goflex Home 2tb drive connected to my router as a Time Machine backup drive.  I use this for three things 1)Time Machine 2) an occasional backup of  windows document subdirectory  3) backup of music and photos for long term storage.   Doing something like re-partioning the drive is not an option.  I'll just go buy another drive for time machine's sole use. In addition, using software from Seagate is not an option.  I don't want to use their software for different reasons (mainly the GoFlex home is really designed as a "media server"  which I don't use.  I, of course, use iTunes. ) On the Mac, I'm only using about 250GB total but time machine is rapidly using up space.
    Apparently using a terminal command like below, used to work,  but no longer works under Yosemite.
    For a limit of 100gb the number below would be 100 x 1024
    sudo defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 102400
    To remove the limit, use the following command:
    sudo defaults delete /Library/Preferences/com.apple.TimeMachine MaxSize
    Now, I'm not too familiar with terminal and I'm not about ready to issue a command without knowing exactly what it is going to do.
    Is there an easier "switch" someplace or an app that does this?
    If I don't limit the size, at some point there will not be any space left for windows backups and additional photo and music files.

    Hmm- added "sudo" and there was no error reported:
    sudo defaults write /Library/Preferences/com.apple.TimeMachine MaxSize xxxxxx
    I guess we'll see.

  • How to fetch the amounts /460,/4MT,/4ME,/4MH and /470 in custmoized report

    Deae Experts,
    we are developing a customized report on TDS for a particular month.
    For this we need to extract the amounts of /460,/4MT,/4ME,/4MH and /470 wagetypes.
    How and where we have to  extract/fetch  the  amounts to have these  values in the customized report.
    Please advice.
    Regards,
    Vi Sai

    Hi Experts,
    I want to extract the above details after payroll posting to accounts.
    I have tried to have the details form PCP0,there i can only view the /460 details.But the rest of details i can able to see.
    Where shall and from which trasaction code(Any Finance trasaction code) we extract the amounts of  /460,/4MT,/4ME,/4MH and /470 for the employees.
    Please advice.
    Regards,
    V sai.

  • How to club the amount field for the particular customer from file

    Hi ,
    In my BDC i am getting the Amount field which is need to be put in the Header data . For 1 Customer there are more than 5 line in amount field in the Excel file.
    For the Particular Customer , I need to club all the amount ffield and put it into the Heade data for the customer.
    How to do this .
    Thanks

    got answer

  • How to Sum the intervals

    Sir,
    I would like to use the SUM function in summing the intervals like this statement:
    SELECT
    DATE_VALUE,
    DAY_NAME ,
    SUM(CAST(TIME_OUT as time) - CAST(TIME_IN as time)),
    EMPLOYEE_ID
    FROM [table name]
    WHERE
    [where clause]
    GROUP BY
    DATE_VALUE,
    DAY_NAME ,
    EMPLOYEE_ID ;Please note that: TIME_OUT, TIME_IN is timestamp;
    But there is an error while executing this statement:
    SUM(CAST(TXN_OUT as time) - CAST(TXN_IN as time)) ,
    ERROR at line 9:
    ORA-00932: inconsistent datatypes: expected NUMBER got INTERVALSo, how can I do sum for intervals.
    Thank you in advance.

    I am certain noone is looking for the ytom interval equivalence, but I liked to post it...
    select numtoyminterval(
        sum(
        (   to_number(to_char(timestamp '3000-01-01 00:00:00' + x,'YYYY'))-
            to_number(to_char(timestamp '3000-01-01 00:00:00','YYYY'))
        ) * 12 +
            to_number(to_char(timestamp '3000-01-01 00:00:00' + x,'MM'))-
            to_number(to_char(timestamp '3000-01-01 00:00:00','MM'))
         , 'MONTH')
    from
    (select numtoyminterval(11, 'month') x from dual union all select numtoyminterval(1, 'year') from dual union all select numtoyminterval(100, 'year') from dual);
    +000000101-11

  • How to print the amount of Rs. 10.50 as 'Ten Rupees fifty paise 'only?

    In smartform I want to get the amount of Rs. 10.50 as
    'Ten Rupees fifty paise 'only.
    How I can get this?
    I have tried it with 'Spell_Amount' but in this case it cannot recognise the decimal.
    How to solve this problem?
    Please help me. This is very urgent.
    Thanks in advance.
    Regards,
    Anindita

    Hi,
    Try this,
    data : var(100),
           salary_words(100).
    call function 'HR_IN_CHG_INR_WRDS'
      exporting
        amt_in_num              = sal
    IMPORTING
       AMT_IN_WORDS             = var
    EXCEPTIONS
      DATA_TYPE_MISMATCH       = 1
      OTHERS                   = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
          sal_words = sal.
          salary_words = var.
    TRANSLATE salary_words TO LOWER CASE.
          data : len(2),
                 index type sy-index.
        len = strlen( salary_words ).
    DO len TIMES.
          index = sy-index.
          if index = 1.
          TRANSLATE salary_words+index(1) TO UPPER CASE.
          endif.
          if salary_words+index(1) = ' '.
          TRANSLATE salary_words+index(1) TO UPPER CASE.
          endif.
           ENDDO.
           sal_words = salary_words.
    Regards
    hiddu.

Maybe you are looking for

  • VARRAY as Stored Proc output parameter

    VARRAY as Stored Proc output parameter I have an Oracle VARRAY data type declared as follows: CREATE TYPE NUMBER_ARRAY AS VARRAY(100) OF NUMBER; I have a stored procedure which takes a single input and returns a NUMBER_ARRAY as output: CREATE OR REPL

  • Any quick way of deleting the "sticky" I and O points in Events?

    The sticky In and Out points in Events can be useful but there are times I would lke to remove them. Is there a quick way other than by grabbing each point and dragging it to the start or end of the clip?

  • PAC Provisioning Fails Without End-User Accepting PAC Pop-up

    We have lots of workstation on wheels. We use EAP-Fast with Cisco ACS for authentication. When a user isn't in front of the WOW and the PAC pop-up times out, it disables the WOW and causes problems. Has anyone used some form of auto-accept method wit

  • Refund for itunes purchase

    I had an item in my wishlist that I didn't mean to purchase. What is the process for obtaining a refund on a iTunes purchase? Thanks

  • Editing feature in snow leopard

    I installed snowleopard on my desktop and have had Ilife 09 on there as well.Now the edit feature in iphoto goes to a single red color on the screen.