How to get ONLY month and MONTH within date...

I have to convert something from sql server to oracle.
In SQL Server I have:
SELECT
         TEXT_26 AS CostUnit,
         MILESTONE_DATE AS ContractShipDate,
         ACTUALFINISH AS ActualShipDate FROM PROJ_TASK
WHERE
          TEXT_29='SHIP'
          AND NAME NOT LIKE 'CMSB%'
          AND NAME NOT LIKE 'CCFB%'
          AND (MONTH(ACTUALFINISH) = MONTH(GETDATE()) - 1)All seems very simple SQL except I don't know how to convert that last line:
...         AND (MONTH(ACTUALFINISH) = MONTH(GETDATE()) - 1)Basically Im just extracting the month so that I say the MONTH of the actual finish date is equal to the month of Today - 1. Meaning get the month for today (GETDATE() in sql server) and then subtract ONE month from it.
How can I do that line in oracle?
Thanks,
Jon

I generally find it simplier if one answers the question I posedYou need to realize that with free advice and help you get what you pay for. If you want people to run the statements for you then you should provide create table and sample data scripts.
Another alternative is
trunc(actualfinish,'mm') = add_months(trunc(sysdate,'mm'),-1)http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions201.htm#i79761
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions004.htm#i76717

Similar Messages

  • How to get missing year and months

    hi,
       I have to get count of each month of each year using SP
    the parameters are date range , it can be
    more than one year.
    the problem is, in database there is data for few months only , but user can enter a big date range.
    and i have show each month's count, if it does not exits then each month should show 0.
                 one approach was to get the count existing data for each year-month in a temp table, then loop through to insert missing year-month and finally select them.
                second approach was to create temp table of year-month which is passed from parameter, buy subtracting two dates. then use left join to get the above result.
    please suggest if there is any other way to accomplish the task?
    yours sincerely

    Can you show sample data + expected result?
    SELECT COUNT(*) ,MONTH(dt) m, YEAR(dt) y FROM tbl
    GROUP BY MONTH(dt), YEAR(dt)
    but , I am only guessing, moreover , if you are using SQL Server 2008 and onwards take a look at grouping sets fetaure
    SELECT custid, empid, YEAR(orderdate) AS orderyear, count(qty) AS qty
    FROM dbo.Orders
    GROUP BY GROUPING SETS
      ( custid          ),
      ( empid           ),
      ( YEAR(orderdate) )
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to get Current day and month value in Stk applets

    Friends please provide me the hint to get the Current Value of month and date from the Mobile equipment(ME).
    please send feedback to [email protected]

    Use "PROVIDE LOCAL INFORMATION" command as per GSM 11.14. This however queries the handset date and time, and hence depends on the handset clock (which may not always be reliable).

  • How to Get As is and As was data using Hierarchies.

    Hi Experts,
    I have scenario,  I want to report sales by the Sales Organization Hierarchy..
    A- B- ORG1 -( 01/2010 - 05/2010)   -
       100
    After 05/2010 my ORG1 has been changed from B to C then my Hierarchy looks like this
    A-C- ORG1 - ( 06/2010 to 12/999) -
    500
    if i build a time dependent Hierarchy on Organization and run a report for calendar month selection as 01/2010 to 12/2010. it is showing the net sales for the Organization  A as 500 only,  the quantity 100 is not showing in the report as the hierarchy structure is not valid for the current date.
    How to model a BW Hierarchy which shows  AS is and As was Data in the report using Hierarchy..
    Thanks
    Bhanu

    Hi,
    Have you tried to make nodes time-dependent and not the whole hierarchy?
    If this is not enough then I am afraid you should not use external hierarchies for this and change data model.
    You can use only ONE hierarchy version in the same time.
    HAve you tried to map this hierarchy to attributes of Org Structure?
    If A is an attribute of Sales ORg you can use it in the report in the way it is required.
    Sorry, I couldn't help.
    Edited by: ASUC on Nov 24, 2010 6:54 PM

  • How to get the Full and final settelment date from PC_payresults

    Hi Experts..sairam.
    We are preparing Functional specification  for a report on Full and final settelement.
    We need to extract the  full and final settelement date from  payresults.
    Full and final settelement would be an offcycle run.
    How can we identify the particular Offcycle is meant for full and final settelment.
    Full and final settelement can be done after date of relieving.
    Please share your ideas to get the field names and logic to fetch.
    Thanks in advance.
    Regards,
    Sairam.

    Hi Praveen,
    I found it from HRPY_RGDIR through SE11.
    But im in confusion in thinking on Logic to find the Full and final settelment processed date.
    First of all..Report has to check WPBP table weather Employment status is Zero.
    Later..It has to read the HRPY_RGDIR table.
    Here what the system to check.What conditions to be validated to fetch the Full and final settelment processed date.Will it be FPPER and INPER as 00000000 or shall we do it from offcycle reason.
    Please share your ideas.Thanks in advance.
    Regards,Sairam.

  • DM 3.0 Production: How to get only indexes and constraints to DDL?

    I'd like to have a DDL file that contains all of the indexes and constraints of my model. From DDL Generation Option I only check all PK and UK constraints and all indexes and leave everything else unchecked. The DDL that I get is empty...

    I'd like to have a DDL file that contains all of the indexes and constraints of my model. From DDL Generation Option I only check all PK and UK constraints and all indexes and leave everything else unchecked. The DDL that I get is empty...

  • In Table Control How to get only a single row .

    Hi
    In Table Control How to get only a single row .I am able to decrease it its height to 4 but then 2 rows is getting dsplayed .I want only one row to be display and 2nd row should be deactivated or not visible.
    regards
    Avik
    Edited by: Julius Bussche on Jan 30, 2009 1:10 PM
    Removed friendly greeting from the subject title

    Hi Avik
    use this code it will help you.
    MODULE passdata OUTPUT.
      READ TABLE it_revision INTO wa_rev INDEX tab_clc-current_line.
      IF sy-subrc = 0.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.      " 111 IS THE GROUP NAME
            screen-input = 1.          " input mode
            screen-active = 1.         " input mode.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = '111'.       "GROUP NAME
            screen-input = 0.           " display mode
            screen-active = 1.          " DISPLAY MODE.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDMODULE.                 " PASSDATA  OUTPUT
    Make sure in group tou are passing the field name that you want in input mode on the base of other field
    Hope it will help you.
    Thanks
    Arun Kayal.

  • How to get only current exception message from tables

    Hi
    In my sceanario , I want to have the list of Current MRP exception messages list from table
    I understand that MRP detailed lists, including all exception messages, are stored in transparent table MDKP and cluster table MDTC.
    I can tell ABAPer to write a report for me , to read the data from these tables , but I guess these tables contain old exception message also , which are not currently appearing in MRP list
    How to get only current exception message
    Rgds,
    sandeep

    Sandeep,
    MDTC contains only data from the most recent MRP run.  So, all messages you see are those which are currently valid.
    The messages might have first appeared during a previous run, but they still need to be addressed.
    Before you invest a lot of time and effort into writing and debugging a custom report, you should probably try to use the standard SAP functionality found in MD06.  On the Processing indicator tab, you can select "Only with new exceptions".  Here you can tag a material/plant as 'processed', and thereafter, the exceptions that existed there before you tagged the part will not be re-displayed.
    Best Regards,
    DB49

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • How to get only the first result in extract function

    do you know how to get only the first element of the function extract.
    v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
    if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
    thanks in advance

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get automatic plant and shipping point and storage location

    hi,
    sap gurus,
    how to get automatic plant and shipping point and storage location automatically into the sales order
    i have done all the config settings for that
    but its not appearing automatically.
    regards,
    balaji.t

    Hi
    Balaji...
    U can get the plant in sales order,  by doing the default the same in customer master or in  material master. In customer master -- sales are data--shipping tab delivering plant there u can assign and get the same in order for that customer. it is better to do in customer master rather than in material master.
    Shipping point is getting determine in sales order and u can not make it default like plant. Shipping point is determine in the basis of Shipping condition of customer ( ship to party)+ loading group of material + Deliverying plant there u have to assing the shipping point and it will flow in the sales order. Tcode OVL2
    For S loc u have to enter manually in the sales order u can not get it automatically.
    Hope this will help you.
    Thx.

  • How to get count,index and compare to arraylists

    hi
    how to get count,index and comparing of 2 arraylist.... plz suggest me asap...

    How is your question related to JDBC? And what have you done so far with your code?

  • How to get system status and user status ?

    how to get system status and user status for the given production order?
    In which PP table we can
    find these?
    Thanks&Regards
    Satish

    Hi Ram,
    Use the FM "STATUS_READ" to read both the system and user statuses for an Order.
    Alternatively, the following tables store the user and system status info:
    JSTO- Status object information
    JEST- Individual Object Status
    Hope this helps.
    Let me know if u need further information.
    Regards,
    Sonal

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • How to get only the CD ROM / DVD ROM units

    Hy to everybody,
    I have a little problem and i hope someone could help me.
    The problem is like this i've whant to list all the CD/DVD units, not all the units.
    For exemple if i have C: D: E: G: and C: and D: are hdd and E: it's a CD unit and G: it's a DVD unit i whant to get only D: and G: .
    I've tried with File.listRoots().
    but this gives me all the units. It's there a way to specify the type of the units i whant to get?
    Thanks for your help.

    Some systems can mount a file system against a file containing an iso image.
    Does such a file system qualify as a CD/DVD unit or not?
    If a CD/DVD drive is shared by another box and it is being accessed as a network drive, does it qualify as a CD/DVD unit?

  • How to get total numbers and total price in query reports

    Hi,
    how to get total numbers and total price in query reports.for example:
    particular item is issued 3 times a week...I need total quantity of item issued
    my query...
    SELECT T0.[DocNum], T1.[ItemCode], T1.[Quantity], T1.[Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'

    Hi,
    Try this:
    SELECT T1.[ItemCode], SUM (T1.[Quantity]) as [Total Quantity], SUM (T1.[Quantity] * T1.[Price]) as [Total Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'
    Group By T1.[ItemCode]
    Beni.

Maybe you are looking for

  • Is there a way in Oracle to return multiple rows as a single string?

    Hi gurus, I just got help from your guys fixing my dynamic sql problem. What I am doing in that function is to return a single string from multiple rows and I use it in the select statement. It works fine once the problem was solved. But is there any

  • EXCEL Web Query  - load into SAP via Web dynpro or standard ABAP

    Hi everybody I was wondering if you can run an EXCEL WEB Query from abap and then upload the data retrieved from the web into SAP using either a web dynpro application or standard SAP. For standard ABAP one could probably run the EXCEL web query by e

  • [SOLVED] Trouble using WiFi

    I haven't had problems with this before, but then again, I don't use WiFi a whole lot. ArchLinux simply cannot use WiFi, even if it's connected. I'm not sure why that is. I am connected using the GNOME interface and what I assume is NetwokManager, al

  • Enquiry about language problem?

    Hi, My phone is nokia n82 USA version. I would like to know am i able to update the Firmware from Malaysia Version? Because i guess if i update to Malaysia version firmware so that i can get a chinese language support. Is it possible to do so? Many t

  • Iphoto unexpected failure, please help!

    Hi, I'd really appreciate some help, my iphoto has suddenly stopped opening, and show an error message. I have tried some of the previous suggestions, such as: Terminal, run sudo update_dyld_shared_cache -force But that hasn't worked at all. I'm on h