How to get the first 3 characters from the previous month?

Hi,
I need to get in a View Column only the first 3 characters of the previous month of data from the bellow query.
SELECT ID, Department, Capital_Project_Number, 
Capital_Site_Number, 
Funding_Source, Milestone, 
Account, Year, Month, Data
FROM  Table
Where Month = DATENAME(Month, DATEADD(Month, - 1, GETDATE())) and (Year = YEAR(GETDATE()));
Go

 Left(DATENAME(Month, DATEADD(Month, - 1, GETDATE())),3)
--Or
 convert( varchar(3), DATEADD(Month, - 1, GETDATE()),100)

Similar Messages

  • How to get the previous month and year accordingly

    Hi friends,
    I wanted to select month as number like 4 and year as 2011
    but I want to select the previous month as of sysdate
    like if the sysdate is 10-jun-2011
    it should give me 5 as month and
    in the year it should give as 2011
    if the sysdate is 01-jan-2012
    the month should be as 12 and year should be as 2011
    thanks

    Hi,
    776317 wrote:
    thanks a lot I just dont need the 0 being prefixed... can you pls tell how to avoid that as well pls
    TO_CHAR ( ADD_MONTHS (SYSDATE, -1)
            , 'FMmm yyyy'
           )For details about how the FM modifier works, wee the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements004.htm#sthref456

  • How to get the previous state of my data after issuing coomit method

    How to get the previous state of some date after issuing commit method in entity bean (It should not use any offline storage )

    >
    Is there any way to get the state apart from using
    offline storage ?As I said the caller keeps a copy in memory.
    Naturally if it is no longer in memory then that is a problem.
    >
    and also what do you mean by auditlog?
    You keep track of every change to the database by keeping the old data. There are three ways:
    1. Each table has a version number/delete flag for each record. A record is never updated nor deleted. Instead a new record is created with a new version number and with the new data.
    2. Each table has a duplicate table which has all of the same columns. When the first table is modified the old data is moved to the duplicate table.
    3. A single table is used which has columns for 'table', 'field', 'data' and 'activity' (update, delete). When a change is made in any table then this table is updated. This is generally of limited useability due to the difficulty in recovering the data.
    All of the above can have a user id, timestamp, and/or additional information which is relevant to the data being changed.
    Note that ALL of this is persisted storage.
    I am not sure what this really has to do with "offline storage" unless you are using that term to refer to backed up data which is not readily available.

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • How to get the current month number

    Hi everyone,
    Does anybody know how to get the current month number in Oracle Discoverer Worksheet calculation?
    I try to use EUL_DATE_TRUNC(CURRENT_DATE, 'MM'), but instead I got 01-AUG-00.
    If I change the data display format to MM, it will give me "08" but if I use TO_NUMBER function to convert it to number I get error "invalid number"
    Is there anyway to get the current month value in number? Thanks

    Scott,
    Thank you so much! It works perfectly! :)
    Hope you have a great day ahead!
    Cheers,
    Angeline

  • How to Get the current month at timezone UTC-10

    Hi All,
       can you please let me know How to Get the current month at timezone UTC-10.
    Function module ? which date and time needs to pass.

    Hi,
    Try with following code.
    DATA zdate TYPE  D.
    DATA ztime TYPE  T.
                      CALL FUNCTION 'ISU_DATE_TIME_CONVERT_TIMEZONE'
                        EXPORTING
                          x_date_utc          = sy-datum
                          x_time_utc          = sy-uzeit
                          x_timezone          = 'UTC-10'
                       IMPORTING
                         Y_DATE_LCL          = zdate
                         Y_TIME_LCL          = ztime
                       EXCEPTIONS
                         GENERAL_FAULT       = 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.
    WRITE : zdate, / ztime.
    Thank you,
    Sekhar.

  • How to get the currrent month and year from a new date object

    If I create a new Date object as "d",
    java.util.Date d = new java.util.Date();how can I format the date to get the current Month as 'Jan' and the current year as '2008'. So if I have something like d.getMonth() gets the current month as 'Oct' and d.getYear() gets '2008'
    Thanks,
    Zub

    [Read the flamin' manual you must. Hmm.|http://en.wikipedia.org/wiki/RTFM]
    ~~ Yoda.
    Well no actually, he didn't say that, but he should have.
    Cheers. Keith.
    PS: Don't say that to a 7 foot pissedOff wookie when he's got his head stuck in a smoking hyperdrive, and you're being chased by a S-class battle cruiser... Ask Yoda how he got to be so short.
    PPS: It is the SimpleDateFormat you seek ;-)
    Edited by: corlettk on 14/10/2008 22:37 ~~ Also far to slow... but funny.

  • How to get the count monthly wise

    Hi All
    I have lot of order dispatched in a year 2010, how to get the moth wise total.
    For example jan 1000 orders ,feb 2500 orders.
    Thanks & Regards
    Srikkanth.M

    Pleiadian wrote:
    Maybe even
    b.schedule_ship_date between to_date('2010','YYYY') and to_date('2011','YYYY');)But this could return schedule ship dates that are 01-Jan-2011 00:00:00. I don't think this is wanted since it was not specified in the original requirement. I'm not even sure if to_date('2010','YYYY') returns 01. Feb.2010 in a few days (when we will have february).
    Just checking the docs....
    found it: http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#SQLRF51062
    from the docs:
    If you specify a date value without a time component, then the default time is midnight (00:00:00 or 12:00:00 for 24-hour and 12-hour clock time, respectively). If you specify a date value without a date, then the default date is the first day of the current month.Just to be on the safe side always give the complete format mask!
    b.schedule_ship_date >= to_date('01012010','DDMMYYYY')
    and b.schedule_ship_date < to_date('01012011','DDMMYYYY')Edited by: Sven W. on Jan 17, 2011 5:14 PM

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • How to get the previous version of Flash professional?

    I need to install flash proffessional on 32 bit computer? How can I get the previous version as the Flash ProfessionalCC requires 64 bit?
    Many thanks for help.

    Hi Barbara,
    Flash Professional CS5.5 is a 32-bit application which can be installed on computers with either 32-bit or 64-bit operating systems.
    You can purchase this by Adobe's backward Licensing policy :
    " Adobe allows program members to order a current-version license but use a prior version. These members can contact Adobe Customer Service to request a serial number for the earlier version if they do not already have one. Prior-version software is available via ESD and can be purchased through standard resellers. The program member must follow all guidelines of the current-version EULA. "
    Please check the doc : http://www.adobe.com/volume-licensing/policies.html

  • How to get the previous price of the  list price  in a order

    Hi All,
    I need to get the previous price of the condition type in an order  to calculate the %change of price.
    for ex: the conditon ZXXX has price 600 and its changed to 400 now .( by changing the quantity etc ).
    when the price value is changing to 400 , I need to capture  the value of 600 in another condition type.
    how can i acheive this ? Any idea?
    Please provide some pointers on it.
    Thanks in advance.
    Swapna.

    Hi Viraylab,
                     check  <b>VBAP-NETPR</b> field of table <b>VBAP</b>
    It gives the net price corresponding to a line item.
    Goto Tcode VA03.See the <b>item overview</b> tab U will get <b>Net Price</b> field for indivisual line item.
    Reward points if helpful.
    Regards,
    Hemant

  • How to Get the Previous Transactional Data into Special Purpose Ledger

    Hi,
    1). We have implemented Special Purpose Ledger. After implementing SPL, we are generating documents and getting the postings into SPL. Now I need to bring the previous postings which were entered before Special Purpose Ledger Setup. Please Help me on how to bring the transacctional data into Special Purpose Ledger.
    2).  Is it possible to define A/R Aging by Customers? in  Special Purpose Ledger by using Report Painter?
    3). What is the use of Allocation Cycles like Assessment and Distribution in Special Purpose Ledger?
    Please clarify me on above 3 points.
    Thanks
    Yadayya
    Edited by: Dogdays on Aug 5, 2011 8:02 AM
    Edited by: Dogdays on Aug 5, 2011 8:03 AM

    I have experience in intergrating project accounting to the general ledger in a data warehouse using discoverer to show the results.
    The solution I developed for my compnay is to ensure all entries from all sub-ledgers including manual journal entries are moved to the data warehouse tables have project information based on PA autoaccounting rules.
    The company I work for was interested in viewing reports that cubed cost centers (dept's.) to projects and to translate all entries (not just account balances) to USD for thier foriegn set of books. So, projects can be seen company wide in USD at lowest entry level. The solution I gave them solved the problem and they are able to view reports and evaluate costs by cost centers and projects on an enterprise wide application.
    If this is what you are looking for let me know.
    about my self : I have a B.S. in Computer Science (Theoretical Track) and 17 yrs of accounting and book keeping experience including consolidation and multi-currency sets of books.

  • I upgraded to firefox 4 but it is not suitable for my version of Mac Os and don't know how to get the previous version of firefox back!

    I downloaded the latest version of Firefox (ie 4) on my Apple laptop, but the fact that it is "unsuitable for (my version of) Mac Os " was not revealed to me until I had already replaced the previous version which was suitable. I don't know how to retrieve the version I was using.

    The latest versions of Firefox require at least Mac OS X 10.5 and an Intel processor. You can revert to Firefox 3.6.xx for Mac 10.4 by downloading the installer from http://www.mozilla.org/en-US/firefox/all-older.html
    More information in the [[Firefox will not start]] article, under
    [https://support.mozilla.com/en-US/kb/Firefox%20will%20not%20start#w_firefox-will-not-start-4on-os-x-10-4-or-earlier-or-with-a-powerpc-processorsf5on-windows-98me-or-earliersf Firefox will not start on OS X 10.4 or earlier or with a PowerPC processor]

  • How to get the previous row selected index of a table....

    Hi friends,
    I have a table. i have a action/event handler defined on its onLeadSelect event.
    In this event, if i use node_code->get_lead_selection_index( ) .. i m getting the newly clicked row index.
    ex: table has 3 rows.
    Row 1 is by default selected. Now if i select the row 3, in my event by using node_code->get_lead_selection_index( ). im getting index 3. which i sel
    But i want to get index 1. 
    kindly help me.. i dont have any other option as i m very new to this.
    hope i gave u correct inputs on my problem.
    thanks in advance,
    Niraja

    One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
    On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
    There could be other ways to achieve this. This is one of the methods.
    Best Regards,
    Rashmi.

  • How to get the previous record in the select statement

    I am trying to update the parent part number as a parent for component part number. I can assign the main part with level 1 as a parent and it looks like this.
    PART_NUMBER     PART_LEVEL     PART_PARENT
    1140000000T     3     1140001755L
    1140001755D     2     1140001755L
    1140001755L     1     
    A1010000139     5     1140001755L
    A1010015001     4     1140001755L
    A1010000139I     4     1140001755L
    A40210062     2     1140001755L
    A1010001579     4     1140001755L
    but, I need to assign the previous level part as the parent part instead of level 1. I can add a new column to store this value. I need the structure as
    PART_NUMBER     PART_LEVEL     PART_PARENT
    1140001755L     1     
    1140001755D     2     1140001755L
    A40210062     2     1140001755L
    1140000000T     3     A40210062
    A1010015001     4     1140000000T
    A1010000139I     4     1140000000T
    A1010001579     4     1140000000T
    A1010000139     5     A1010001579
    We might have multiple parts at the same level, so I need to make sure that correct parent is assigned to the part. Anybody has any idea?
    Thanks

    spooHi,
    How to do that depends on your data.
    Post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data (formatted, within \ tags), if it's not the reuslts you already posted.   If you can show what your problem is using commonly available tables (like scott.emp), then you don't have to post any sample data; just the results.
    Post your existing query, too;.  Always say what version of Oracle you're using.
    It looks like you're currently doing something like this:SELECT     ename
    ,     LEVEL
    ,     CONNECT_BY_ROOT ename     AS root_ename
    FROM     scott.emp
    START WITH     mgr     IS NULL
    CONNECT BY     mgr     = PRIOR empno
    which produces this output:ENAME LEVEL ROOT_ENAME
    KING 1 KING
    JONES 2 KING
    SCOTT 3 KING
    ADAMS 4 KING
    FORD 3 KING
    SMITH 4 KING
    BLAKE 2 KING
    ALLEN 3 KING
    WARD 3 KING
    MARTIN 3 KING
    TURNER 3 KING
    JAMES 3 KING
    CLARK 2 KING
    MILLER 3 KING
    where the last column shows the ancestor *farthest* above the current row.
    If I understand you, you want to have output that shows the *nearest* anacestor, like this:NAME LEVEL PARENT_ENA
    KING 1
    JONES 2 KING
    SCOTT 3 JONES
    ADAMS 4 SCOTT
    FORD 3 JONES
    SMITH 4 FORD
    BLAKE 2 KING
    ALLEN 3 BLAKE
    WARD 3 BLAKE
    MARTIN 3 BLAKE
    TURNER 3 BLAKE
    JAMES 3 BLAKE
    CLARK 2 KING
    MILLER 3 CLARK
    You can do that by changing a single line:SELECT     ename
    ,     LEVEL
    ,     PRIOR ename          AS parent_ename          -- Changed
    FROM     scott.emp
    START WITH     mgr     IS NULL
    CONNECT BY     mgr     = PRIOR empno

Maybe you are looking for

  • Right way of defining constants - Interfaces or Classes?

    Two widely used ways to define constants in java projects are: 1. Interfaces - Define constants in interfaces, they automatically become static, final and then implement the interface in concrete classes that need those constants. 2. Classes - Use no

  • Fault Handling in BPEL process

    hi We have to develop an application which involves several BPEL processes and proxy service(OSB) and JMS queue etc. What is the difference between Fault Management Framework in SOA11g and normal fault handling(using catch and throw activities)? whic

  • OSB Proxy service is not reachable

    Hi OSB experts, The proxy service which is configured in weblogic OSB environment for the application running in Jboss is not reachble with the below stack trace.... Can anyone help me to infer it exactly....or let me know what the below stack trace

  • How to make 2 Node File Cluster with SAS Disks

    Hello, I cant fine any detailed, specific information and answer on this question I have 2 Servers, Say HP, with 4 SAS disks each,  1 for OS (2012R2Data) and 3 available. I want to create fault tolerant SMB 3.0 share for my Hyper-v nodes, to make hyp

  • H264 Decoder buffering 8 frames even in low latency mode

    Hi, I am trying to do hardware video decode in my application. It does H264 decoding using IMFTransform::ProcessInput and IMFTransform::ProcessOutput API. I set CODECAPI_AVLowLatencyMode to avoid any kind of buffering. The app works, however, I see t