Count Number of Month

Hi all,
I have these following column :
start_cycle_date = 1 Jan 2010
end_cycle_date = 1 Jan 2011
I wanna count the total months left everytime i run the query (frequency run = monthly, 29th everymonth).
The total month is 12 months. After run start_cycle_date will be changed.
Example :
First run 29th jan = 11 months left
Second run 1st Mar = 10 months left
Third run on 29th Mar = 9 months left
How can i query to display the correct months left even though i run it on 1st of march for feb??

You can use the function
months_between(date1,date2)
ex: select months_between(sysdate+365, sysdate) from dual;

Similar Messages

  • Count number of Months

    Dear,
    Please help me for the following issue:-
    I got a column contain lots of date and "July" are occur more then 1 times. I am looking to count the total number of July.
    Thanks

    Hi kinsinglim,
    This is the forum for Numbers for Mac. Are you doing this on an iPhone? Here is a way on a Mac running OS X.
    Table 1 has a Header Row and a Footer Row. Column A is formatted as Date and Time, with Time "None". Column B is formatted as Automatic.
    To find the Month of the year for each date, formula in B2 (and fill Down) is:
    =MONTH(A2)
    Formula in the Footer Cell B7 is:
    =COUNTIF(B,"=7")
    If this does not work on iPhone, try posting your question in this forum:
    iWork for iOS https://discussions.apple.com/community/app_store/iwork_for_ios?view=discussions
    Regards,
    Ian.

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • How to count number of columns in cross-tab report

    I have created a cross-tab report and have managed to get the data out as below:
                 Jan     Feb     Mar....(display of months will auto expand) Avg/Mo  Total
    UserA     4          3        4                                                                         11
    UserB     6          1        1                                                                          8
    UserC     5          5        5                                                                         15
    Total       15        9        10                                                                        33 
    I want to insert a calculated column (Avg/Mo) into the cross-tab report based on the formula: Total/Number of Months. I used this calculation formula  for Avg.Mo column:
    (GridValueAt(CurrentRowIndex, CurrentColumnIndex+1, CurrentSummaryIndex)/GetNumColumns)
    However, I get the wrong average since GetNumColumns count the total number of columns including the column of Avg/Mo and Total.
    How do i get the number of columns, excluding the Avg/Mo calculated column and Total column?
    PS: I can't use hardcode since the number of months/columns will auto expand the months progress...
    Edited by: jutamind on May 26, 2010 9:27 AM

    ok managed to solve this by slightly changing the formula:
    GridValueAt(CurrentRowIndex, CurrentColumnIndex+1, CurrentSummaryIndex)/(GetNumColumns-2)

  • Derive Number of months from variable entry

    I have a requirement to calculate the average sales qty using the number of months entered in the variable entry and not the actual number of months the product was sold. For example Variable cal month entered as the range 01/2009 - 03/2009. The average needs to be calculated with the 3 month range even if sales only occurred in months 01 and 02. I understand I need to create a formula variable type customer exit, but I need assistance in creating the formula that would count the number of months from the variable entry.
    Any help would be appreciated.
    Craig

    Hi,
    Yes you can replace the variable and use if the code has been declared in such a way. Use i_t_var_range instead of It_var_range. This is a table which should been defined in your existing code.
    I have modified the code. Hope this helps
    WHEN 'FORMULAVARIABLE'.
    IF I_step = 2.
    CLEAR l_s_var_range.
    LOOP AT l_t_var_range INTO l_s_var_range WHERE vnam = 'MONTH_VARIABLE'.
    CLEAR l_s_range.
    l_s_range-low = l_s_var_range-high4(2) - l_s_var_range-low4(2) + 1
    IF l_s_range-low < 0.
    l_s_range-low = l_s_range-low + 12
    endif.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    CLEAR l_s_range.
    ENDLOOP.
    endif.
    Regards
    Akhan

  • How to Calculate number of months between two dates

    Hi All,
       In one of the fomr developments, I have to calculate the
    Number of Days
    Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,
    After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.
    I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.
    The most interesting point is the DATE object is not getting created when i write  the below code
      var startDate = new DATE(oYear, oMonth, oDay);
    I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines
    var oTemp = startDate.getFullYear();
    xfa.host.messagebox(oTemp);
    So, there are so many unclear things,
    If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful
    Regards
    PavanChand

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Please let me know how to Count Number of completed line items in past 6 mo

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how
    Krishna

    Hi Experts,
    I dont have a defined Restricted key figure yet.
    I have populated 0COMPL_DEL(Delivery Completed Indicator)  and 0EBELN (Purchasing Document Number) and 0EBELP (Line Item Number in Purchasing Document) .
    This is what I think how I need to calculate:
    Number of completed line items in past 6 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 6 months
    and
    Number of completed line items in past 12 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 12 months
    Please let me know if the logic is correct. If so, how I can create this in report

  • SSRS how to get for number of months

    Hi All;
    below is my SSRS expression 
    =Cdate(Format(Cdate(Mid(Fields!createdon.Value,4,2) & "/" & Mid(Fields!createdon.Value,1,2) & "/" & Mid(Fields!createdon.Value,7,4)),"MMMM yyyy"))
    which gives me the month in MMMM yyyy format in Jan 2014, Feb 2014, Mar 2014... so on
    i need to remove a average of a month 
    i.e Months value/No of months
    I do i get number of months dynamically in SSRS
    Any help much appreciated
    Thanks
    Pradnya07

    Hi Pradnya07,
    In your scenario, it seems that the createdon is a string data type field with this format: 15/09/2014.
    If we want to get the number of the month in the createdon field, we can directly use the expression below:
    =cint(Mid(Fields!createdon.Value,4,2))
    If you also need to get the average data for a month like ‘Months value/No of months’, please refer to the following expression:
    = Fields!Amount.Value /cint(Mid(Fields!createdon.Value,4,2))
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to Count number of words in a file....

    Hi Experts,
    I have uploaded the text file, from the application server, like this: 
    call function 'GUI_UPLOAD'
      exporting
        filename = LV_ip_FILENAME
      tables
        data_tab = LT_FILETABLE.
    The text file contains some number character words....  like "sap labs india..... "
    Now, I wanted to count number of words in an internal table  LT_FILETABLE....  can anybody help me?

    Hi,
    Special Characters in Regular Expressions
    The following tables summarize the special characters in regular expressions:
    Escape character
    Special character Meaning
    Escape character for special characters
    Special character for single character strings
    Special character Meaning
    . Placeholder for any single character
    C Placeholder for any single character
    d Placeholder for any single digit
    D Placeholder for any character other than a digit
    l Placeholder for any lower-case letter
    L Placeholder for any character other than a lower-case letter
    s Placeholder for a blank character
    S Placeholder for any character other than a blank character
    u Placeholder for any upper-case letter
    U Placeholder for any character other than an upper-case letter
    w Placeholder for any alphanumeric character including _
    W Placeholder for any non-alphanumeric character except for _
    [ ] Definition of a value set for single characters
    [^ ] Negation of a value set for single characters
    [ - ] Definition of a range in a value set for single characters
    [ [:alnum:] ] Description of all alphanumeric characters in a value set
    [ [:alpha:] ] Description of all letters in a value set
    [ [:blank:] ] Description for blank characters and horizontal tabulators in a value set
    [ [:cntrl:] ] Description of all control characters in a value set
    [ [:digit:] ] Description of all digits in a value set
    [ [:graph:] ] Description of all graphic special characters in a value set
    [ [:lower:] ] Description of all lower-case letters in a value set
    [ [:print:] ] Description of all displayable characters in a value set
    [ [:punct:] ] Description of all punctuation characters in a value set
    [ [:space:] ] Description of all blank characters, tabulators, and carriage feeds in a value set
    [ [:unicode:] ] Description of all Unicode characters in a value set with a code larger than 255
    [ [:upper:] ] Description of all upper-case letters in a value set
    [ [:word:] ] Description of all alphanumeric characters in a value set, including _
    [ [:xdigit:] ] Description of all hexadecimal digits in a value set
    a f
          v Diverse platform-specific control characters
    [..] Reserved for later enhancements
    [==] Reserved for later enhancements
    u2192 More
    Special characters for character string patterns
    Special character Meaning
    Concatenation of n single characters
    {n,m} Concatenation of at least n and a maximum of m single characters
    {n,m}? Reserved for later enhancements
    ? One or no single characters
    Concatenation of any number of single characters including 'no characters'
    *? Reserved for later enhancements
    + Concatenation of any number of single characters excluding 'no characters'
    +? Reserved for later enhancements
    | Linking of two alternative expressions
    ( ) Definition of subgroups with registration
    (?: ) Definition of subgroups without registration
    1, 2, 3 ... Placeholder for the register of subgroups
    Q ... E Definition of a string of literal characters
    (? ... ) Reserved for later enhancements
    for more details please refer the following,
    [http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX_SIGNS.htm]
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/902ce392-dfce-2d10-4ba9-b4f777843182?QuickLink=index&overridelayout=true]
    Thanks,
    Renuka S.

  • How to count number of edges using PXIe-6363 Counters

    Hello,
    I am trying to count number of edges in a test signal in a 50 ms duration. I am using PXIe-6363 card and connecting the test signal to CTR 0 SRC (PFI 8). Is it a correct connection? What else do I need hardware-wise to make a correct set up for this application?
    Thanks
    Jeet
    Solved!
    Go to Solution.

    Hi Jeet,
    When you say interrupt signal, do you mean a pulse that will pause your counter task? If that is the case, and you want to pause your task with a digital pulse, you need to use the DAQmx Trigger Property Node and set that to Pause, Trigger Type. As you said, you can connect that signal coming from the chip to any PFI line and then set that line as the source of the property node.
    There is an example that you can use that does exactly what I just described. This example is called Count Digital Events-Pause Trig.vi, and you can find it by going to Help>Find Examples..., then on the NI Example Finder window go to the Browse tab and navigate in the folders to Hardware Input and Outpout\DAQmx\Counter Measurements\Count Digital Events.
    Regards.
    Jorge
    Applications Engineer
    National Instruments
    Certified LabVIEW Associate Developer (CLAD)

  • How to count number of raw & put result top of page?

    I try to count number of table raw it work fine  but when I wont to put result top of page it dose not work
    only count one table raw
    REPORT  ZTEST.
    DATA: it_sflight TYPE TABLE OF Sflight WITH HEADER LINE  .
    DATA counter TYPE i VALUE 0.
    start-of-SELECTION.
    SELECT-OPTIONS: carID for it_sflight-carrid.
    SELECT-OPTIONS: connID for it_sflight-connid.
    SELECT * FROM Sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight 
    WHERE carrid IN carID and connID IN connid.
    loop at it_sflight .
      counter = counter + 1 .
      write: /5 it_sflight-carrid,sy-vline,
               30 it_sflight-connid,sy-vline,
                  45 it_sflight-fldate,sy-vline,
                    60 it_sflight-currency,sy-vline.
    ULINE.
    endloop.
    end-of-SELECTION.
    TOP-OF-PAGE .
    *START-OF-SELECTION.
    WRITE:  'Total Rows : ', counter.
    ULINE.
    WRITE: /5 'Carrid',sy-vline,
            30 'Connid',sy-vline,
            45 'Fldate',sy-vline,
              60 'Currency',sy-vline.
    ULINE.
    how can I solve this problem ?

    Hi
    Instead of using counter in a loop use describe statement.
    Describe it_sflight.
    the no of rows will get populated in the system variable sy-tfill.
    DATA: it_sflight TYPE TABLE OF Sflight WITH HEADER LINE  .
    DATA counter TYPE i VALUE 0.
    start-of-SELECTION.
    SELECT-OPTIONS: carID for it_sflight-carrid.
    SELECT-OPTIONS: connID for it_sflight-connid.
    SELECT * FROM Sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight
    WHERE carrid IN carID and connID IN connid.
    DESCRIBE TABLE it_sflight.
    loop at it_sflight .
      counter = counter + 1 .
      write: /5 it_sflight-carrid,sy-vline,
               30 it_sflight-connid,sy-vline,
                  45 it_sflight-fldate,sy-vline,
                    60 it_sflight-currency,sy-vline.
    ULINE.
    endloop.
    end-of-SELECTION.
    TOP-OF-PAGE .
    *START-OF-SELECTION.
    WRITE:  'Total Rows : ', sy-tfill.
    ULINE.
    WRITE: /5 'Carrid',sy-vline,
            30 'Connid',sy-vline,
            45 'Fldate',sy-vline,
              60 'Currency',sy-vline.
    ULINE.
    Thanks
    Rahul jain
    Edited by: Rahuljn on Feb 2, 2011 10:58 AM

  • Get number of month, week and date between 2 dates

    Hi all,
    Is it possible to display number of month, week and days between 2 dates? either by using only SQL query or through PL/SQL...
    Input:
    From date: 01-Oct-2010
    To date: 19-Oct-2010
    I want output as below (Assuming the week starts from Monday to Sunday in oracle).
    01-Oct-2010 -- (Since this is in mid of the week)
    02-Oct-2010 -- (Since this is in mid of the week)
    03-Oct-2010 -- (Since this is in mid of the week)
    40 -- (Oct 4 to Oct 10 falls in 40th week of the year)
    41 -- (Oct 11 to Oct 17 falls in 41th week of the year)
    18-Oct-2010 -- (Since this is in mid of the week)
    19-Oct-2010 -- (Since this is in mid of the week)
    Note: If there is one full month between the given date, then the month number should be displayed.
    After the month, the remaining date comprised with one full week, then the week number of the year should
    be displayed. After displaying the week, the remaining dates should be displayed as it is..
    Appreciate your help..
    Thanks.
    Rajan.

    I suppose if it's just like a calendar type information you want then something like...
    SQL> break on month skip 1
    SQL> set linesize 200
    SQL> set pagesize 2000
    SQL> column month format a20
    SQL> column week format a4
    SQL> with req as (select '&Required_Year_YYYY' as yr from dual)
      2      ,offset as (select case when to_char(trunc(to_date(yr,'YYYY'),'YYYY'),'IW') in ('52','53') then 1 else 0 end as offset from req
      3  select lpad( Month, 20-(20-length(month))/2 ) month,
      4         '('||week||')' as week, "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"
      5  from (
      6    select to_char(dt,'fmMonth YYYY') month,
      7    case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
      8         when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
      9         when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
    10         else to_char(to_number(to_char(dt,'iw'))+offset) end as week,
    11    max(decode(to_char(dt,'d'),'1',lpad(to_char(dt,'fmdd'),2))) "Mo",
    12    max(decode(to_char(dt,'d'),'2',lpad(to_char(dt,'fmdd'),2))) "Tu",
    13    max(decode(to_char(dt,'d'),'3',lpad(to_char(dt,'fmdd'),2))) "We",
    14    max(decode(to_char(dt,'d'),'4',lpad(to_char(dt,'fmdd'),2))) "Th",
    15    max(decode(to_char(dt,'d'),'5',lpad(to_char(dt,'fmdd'),2))) "Fr",
    16    max(decode(to_char(dt,'d'),'6',lpad(to_char(dt,'fmdd'),2))) "Sa",
    17    max(decode(to_char(dt,'d'),'7',lpad(to_char(dt,'fmdd'),2))) "Su"
    18    from ( select trunc(to_date(req.yr,'YYYY'),'y')-1+rownum dt
    19           from all_objects, req
    20           where rownum <= add_months(trunc(to_date(req.yr,'YYYY'),'y'),12) - trunc(to_date(req.yr,'YYYY'),'y') )
    21        ,offset
    22    group by to_char(dt,'fmMonth YYYY'),     case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
    23                                                  when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
    24                                                  when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
    25                                                  else to_char(to_number(to_char(dt,'iw'))+offset) end
    26    ) x
    27  order by to_date( month, 'Month YYYY' ), to_number(x.week)
    28  /
    Enter value for required_year_yyyy: 2010
    old   1: with req as (select '&Required_Year_YYYY' as yr from dual)
    new   1: with req as (select '2010' as yr from dual)
    MONTH                WEEK Mo Tu We Th Fr Sa Su
        January 2010     (1)               1  2  3
                         (2)   4  5  6  7  8  9 10
                         (3)  11 12 13 14 15 16 17
                         (4)  18 19 20 21 22 23 24
                         (5)  25 26 27 28 29 30 31
       February 2010     (6)   1  2  3  4  5  6  7
                         (7)   8  9 10 11 12 13 14
                         (8)  15 16 17 18 19 20 21
                         (9)  22 23 24 25 26 27 28
         March 2010      (10)  1  2  3  4  5  6  7
                         (11)  8  9 10 11 12 13 14
                         (12) 15 16 17 18 19 20 21
                         (13) 22 23 24 25 26 27 28
                         (14) 29 30 31
         April 2010      (14)           1  2  3  4
                         (15)  5  6  7  8  9 10 11
                         (16) 12 13 14 15 16 17 18
                         (17) 19 20 21 22 23 24 25
                         (18) 26 27 28 29 30
          May 2010       (18)                 1  2
                         (19)  3  4  5  6  7  8  9
                         (20) 10 11 12 13 14 15 16
                         (21) 17 18 19 20 21 22 23
                         (22) 24 25 26 27 28 29 30
                         (23) 31
         June 2010       (23)     1  2  3  4  5  6
                         (24)  7  8  9 10 11 12 13
                         (25) 14 15 16 17 18 19 20
                         (26) 21 22 23 24 25 26 27
                         (27) 28 29 30
         July 2010       (27)           1  2  3  4
                         (28)  5  6  7  8  9 10 11
                         (29) 12 13 14 15 16 17 18
                         (30) 19 20 21 22 23 24 25
                         (31) 26 27 28 29 30 31
        August 2010      (31)                    1
                         (32)  2  3  4  5  6  7  8
                         (33)  9 10 11 12 13 14 15
                         (34) 16 17 18 19 20 21 22
                         (35) 23 24 25 26 27 28 29
                         (36) 30 31
       September 2010    (36)        1  2  3  4  5
                         (37)  6  7  8  9 10 11 12
                         (38) 13 14 15 16 17 18 19
                         (39) 20 21 22 23 24 25 26
                         (40) 27 28 29 30
        October 2010     (40)              1  2  3
                         (41)  4  5  6  7  8  9 10
                         (42) 11 12 13 14 15 16 17
                         (43) 18 19 20 21 22 23 24
                         (44) 25 26 27 28 29 30 31
       November 2010     (45)  1  2  3  4  5  6  7
                         (46)  8  9 10 11 12 13 14
                         (47) 15 16 17 18 19 20 21
                         (48) 22 23 24 25 26 27 28
                         (49) 29 30
       December 2010     (49)        1  2  3  4  5
                         (50)  6  7  8  9 10 11 12
                         (51) 13 14 15 16 17 18 19
                         (52) 20 21 22 23 24 25 26
                         (53) 27 28 29 30 31
    61 rows selected.
    SQL>

  • IS THERE A FUNCTION TO RETURN THE NUMBER OF MONTHS OR DAYS?

    I know that you can do a months between function between 2 dates divided by 12 and get years but is there a function that can return the number of months between 2 dates or the number of days between 2 dates in a select statement for a report? These 2 dates are entered in an Oracle forms.
    I have 2 dates.
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    or I have 2 dates
    BEG_SVC_DT 10-JAN-2003 DATE FORMAT
    END_SVC_DT 050924 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I subtract 10 from 24 and get 14.
    In both scenarios the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT' . Is there a function in SQL that would compute the
    number of days between 2 dates?
    Is there a function to get the number of months between 2 dates?
    I have 2 dates.
    BEG_SVC_DT 12-JUL-2004 DATE FORMAT
    END_SVC_DT 050807 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT
    JUL is the 7th month.
    In PLSQL, I subtract 07 from 08 and get 01
    Or I have 2 dates
    BEG_SVC_DT 13-NOV-2004 DATE FORMAT
    END_SVC_DT 050429 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    NOV is the eleventh month. 04 is less than 11.
    In PLSQL I have to add 12 to 04 and subtract 11 from 16 to get 05.
    In both scenarios, the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT'. In SQL, is there a function to compute the number of months between 2 dates?
    I am doing my calculations this way because this is the way that the user has been doing them when they created the report manually.
    The database that I am using is Oracle 9.2.0.6
    Report Writer Report Builder 6.0.8.22.0
    Forms 6.0.8.22.1

    In your example:
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    Where is the "31" depending on, on year and month of BEG_SVC_DT or END_SVC_DT?
    What would be the answer for the following example
    BEG_SVC_DT 25-FEB-1995 DATE FORMAT
    END_SVC_DT 980407 VARCHAR2 FORMAT
    Do I add 28 (=number of days in FEB-1995),
    or 30 (=number of days in APR-1998),
    or 31 (= max number of days in any month?)

  • How to count number of ones in table

    Hello,
     i created one table 16x32 each cell is updating 1 byte of data,how to count number of one in all cell,and is it right way to calculate check sum??
    thank you

    The simplest way is to call GetTableCellRangeValues with VAL_ENTIRE_TABLE as the range, next summing array elements.
    But I don't understand your comment on checksum, so this may not be the more correct method for your actual needs: can you explain what do you mean?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for

  • Ipad 4 unable to detect C4599 Printer already connected to WiFi network

    Hi All, I have a C4599 All in One Printer. I have just set this up sucessfully with a WiFi connection to my home router/ modem network (infrastructure mode). There are no error messages and I can print from a variety of Windows laptops (XP, Vista and

  • ITunes 7.5 won't Respond.  please help!!

    hey all. I'm using Mac OS X version 10.3.9 although it says that it's compatible, I shouldn't have updated iTunes to 7.5 or Quicktime to 7.3. Both applications won't respond. won't open at all. I've been trying to fix this for hours now, and i'm out

  • Can't access url  pc:9001/forms/frmservlet from another pc & only using8888

    Hi, i have a weblogic server installed in Windows 2003 R2 in a domained windows network, i'm using forms & report 11.1.2 and weblogic 10.3.5 after installation every thing is ok, i can access the forms and report from network using the OHS port which

  • SQLite3.dll

    Why do I keep getting "The procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll" when I start up my computer?

  • Missing X-Axis labels in exported excel sheet

    Created chart in Desktop Intelligence. Missing X-Axis labels in exported excel sheet. Please help me on thsi