How can I display previous monthname including the year?

I have the following sql statement:
SELECT Cast(datename(month, dateadd(mm, -1, getdate())) as varchar(15)) + '-' + Cast((DATEPART(YYYY,GETDATE())) As CHAR(4))
The result displays as July-2014 which is correct for previous month...
But on next year January-2015 it will display December-2015.
Is it possible to have the date shown as December-2014?
I appreciate any help.
Thanks in advance.

The date shows the result that I am looking for.
SELECT Cast(datename(month, dateadd(mm, -1, getdate())) as varchar(15)) + '-' + Cast((DATEPART(YEAR,GETDATE()-1)) As CHAR(4))

Similar Messages

  • How can i display a portlet in the Edit view only ?

    Dear All,
    I'm developing a portal in which the end user can change the content of the portal page (personalize) using Edit smart link and i ask How can i display a portlet in the Edit view only ? not shown in the production view ?

    Last time I heard with Oracle they said the only way is to look at the current URL. If it contais _mode=16 then we are in edit mode.
    This is a function I use:
    FUNCTION inEditMode return boolean is
    bEdit boolean := false;
    begin
    if PORTAL.wwpro_api_parameters.get_value('_mode', 'qaz') = '16' then
    bEdit := true;
    end if;
    return bEdit;
    end inEditMode;
    Kind regards
    Tomas Albinsson
    Stockholm, Sweden

  • How can I display on a string the symbol omega (ohms)

    how can I display on a string the symbol omega (ohms)

    Hi,
    See there : http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000032410000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Hope this helps !
    Julien

  • How can I get Firefox to include the http when copying and pasting from the address bar?

    I know you can use "browser.urlbar.trimURLs" in about:config to re-enable the display of "http://" on URLs in the address bar, but I think there's an actual bug with hiding them in the address bar that should be corrected:
    When I click and drag in the address bar to select part of an address, including the beginning of the address, then use CTRL+C to copy it, and CTRL+V to paste it into something else, the pasted URL does not include "http://"; this is often inconvenient and will break in certain forms and so on.
    In Chrome--where I guess the http-hiding feature was copied from--if you click and drag to select part of the URL including the beginning, then copy, when you paste, the "http://," hidden in their address bar, *is* included. That's how it *should* work. Firefox's implementation is incomplete and frustrating.

    This is a known problem and should be fixed in Firefox 8.<br>
    See https://bugzilla.mozilla.org/show_bug.cgi?id=668019<br>

  • How can i display units only for the result set

    hi
    i do not want to display units (example: $ or %) for my key figure columns but i want to display units to the result.
    how can i do that

    Hi Surya,
    I don't think it is possible to have both non-unit and unit in the same kf.
    One potential workaround to do this is to create a calculated key figure/ formula that use the NODIM function for single values. Example: NODIM(0AMOUNT). Then, create a calculated key figure/formula that computes overall result on the same kf and supresses individual values but does not use NODIM....perhaps this can help you work out a solution.
    Hope this helps.
    Regards,
    Petter
    Message was edited by: M Petter

  • How can I display lyrics in iPad, the song which I purchase in iTunes, and added lyrics in iTunes.

    I just brought some song in iTunes, and add lyrics in it, can be display in MAC, but can't display in my IOS8 iPad .  Please help!

    For whatever reason the iPad will not display lyrics, I think its been this way since iOS 7.  The iPhone will display them, but not iPad.  I don't think its a bug, I think Apple wants it this way for some reason ... give your feedback here:
    http://www.apple.com/feedback/ipad.html

  • How can I get Mail to include the entire conversation thread in a reply?

    Hi there,
    So, for work I end up having to manage all my email on the gmail website because people need to be able to see the entire thread and the Mail app doesn't seem to  include everything. It just replies with the most recent message and that's it.
    It works fine on the gmail website so I'm thinking this must be a thing in the Mail app.
    Is there a setting I can change in the Mail app to allow me to reply and include the entire thread by default?
    Thanks!

    Mail menu > Preferences... > Composing
    Choose the applicable preferences under Responding.
    If Mail does appear to show the entire thread, click the blue "See more from..." text at the bottom.

  • How can I display browsing history (like the "history" function in IE)

    In IE when you click "history" you get a list of all the websites visited. In FF "history" only shows Bookmarks. Can I display my browsing history in FF?

    See:
    *[[/questions/932927]] Firefox 14.01 not importing html bookmarks

  • How can I save a layer including the blended multiply effect, separate from background ?

    there might be a simple answer to this, but i can't find one anywhere!
    i have a very simple PSD, so i'll try to explain this super simply..
    one transparent layer, with just a pair or eyebrows, with the only added blend effect as 'multiply'
    one background with a face, no eyebrows.
    the layer blends the eyebrows in to the background face perfectly.
    i want to save the layer as a separate file keeping the tranparency and including the result of the multiply effect, without the background.
    the reason why i want to do this may confuse things, but basically i want several different eyebrow colours to be interchangeable over this face in an application that doesn't recognise the blending link with the background, so i want to save it in PS !
    any clues ?
    andy

    Ok uploaded simple version here.
    no copy merged didn't work, it saves the background image, it's odd I know, but i want to save the resultant layer including the blend effect of multiply transparently without any sign of the background required for said blend function. the two separate layers will then be used in an entirely different 3D scenario where the brows will need to 'appear' blended with the background.
    hopefully i've made the images easy enough, i figure if it's hard to understand what i'm trying to do it's like Einstein said, i can't explain it simply enough
    soo..  here's capture no. 1 showing eyebrow layer with 'multiply', the surrounding hair detail is very finicky after being drawn and needs to blend with different skin shades as per the sample background layer.
    ..and this is no 2, showing the blend multiply effect on the layer with no bg visible, i want this one but with the background multiply pixels, sans background !
    and finally, the layer with normal and no 'multiply' along with the dark background..
    ..hope this helps explain my quandary, it's hard to explain why in detail, but the core problem is that i need to save the layer WITH the effect pixel result of the multiply blend withOUT the background
    really thinking that PS doesn't have the ability to save these pixels in such a way, have found a work-around but this would truly save hours plus make a better finished product for the bizarred 3D application!
    thanks so much for the interest and help
    andy

  • How can I display SQL%ROWCOUNT in the "Process Success Message"

    Hi all;
    I am trying to display SQL%ROWCOUNT in the "Process Success Message" of a custom update Process.
    Any ideas?

    Chris,
    I assume,
    ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID );
    is a package / procedure you call to do something. Change the procedure and add an
    out parameter to it, which will get the
    SQL%ROWCOUNT
    value. Then, call this package like this:
    DECLARE
      in_DEPARTMENT_UID NUMBER;
    BEGIN
      in_DEPARTMENT_UID := :P4_DEPARTMENT_UID;
      ORDER_ITEM_LOAD.MERGE_INTELLI_LABS ( in_DEPARTMENT_UID,  :P4_ROW_COUNT );
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How can I display results data including history

    Hello.
    I am writing a report in Oracle Reports Builder to produce a student's statement of results and have two parameters for course instance and academic year.
    If user enters course instance and academic year the report has to display all results of students where academic year is less than or equal to the academic year
    entered, for the course instance entered as well as the other course instances a student took before that.
    The report should show all results for the previous years and the different course instances within the same course for every student who is enroled on the course instance entered up to the academic year entered.
    E.g. if student did c-inst1 in 2009, c-inst2 in 2010, c-inst3 in 2011, if user enters 2011 for parameter academic year and c-inst3 as course instance, the report should display all the results of students starting from 2011 going back to 2009 for all the three course instances c-inst1, c-inst2 and c-inst3.
    My question is: What conditions should I put in my report in order to be able to show the required results? Please assist. Thanks.

    u mean this?
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    bit_hex_display.vi ‏13 KB

  • How can I display event notes on the relevant event in week/day view?

    Hi folks,
    I'm looking for a way to display the event notes on the actual event in week or day view.
    This will greatly help plan out my week (especially for repetitive events with custom notes for each occurrence).
    I can understand that Apple ommitted this feature to avoid clutter on short-duration events perhaps?
    Clicking on the event (or using the Inspector) to see the notes is not an option. I need an overview that can be viewed at a glance or even printed.
    Looking forward to your suggestions...
    Trev

    Hi Trev,
    With iCal as it is the only suggestion I have would be to add the full text to the title of the events.
    FYI, this is a user to user forum. By posting here you are not guaranteed someone from Apple will read it. If you'd like Apple to know about this I suggest you send them feedback.
    Best wishes
    John M

  • How can I display procedure body in the sqlplus

    Could any one tell me how I can show the procedure/function body in the sqlplus?
    Thanks.

    Select Text from User_source
    where type = 'PROCEDURE'
    and name = '<procedure name>'
    order by line;
    Regards,
    Murali Mohan

  • How can I display the name of my refnum on the front panel?

    I am writing data to a file. To do this, I am using "Open/Create/Replace File" to prompt the user for a filename, which is then output to my VI as a refnum. I then write strings to this file with "Write to Text File".
    How can I display this filename (with the path) on the front panel after the user has input it?
    Michael
    Solved!
    Go to Solution.
    Attachments:
    refnum.JPG ‏45 KB

    Use the Refnum to Path function, in File I/O -> Advanced File Functions palette. You can wire this to a path indicator.

  • How can i display a list of all the names stored in the Mail app?

    When sending an email, the program shows a list of names according to the first and subsequent letters that I type into the To: field. There are times I cannot recall someone's email user name. How can I display a complete list of all the names Mail has stored? I know that I can go to the To: field then type in the letter A, then write down all listings under A, and then repeat for each letter of the alphabet, but there should be an easier method.
    I have perhaps dozens of names in Mail, but only five names in Address Book, so the latter does me no good.

    On the menubar, Mail > Window > Previous Recipients
    Regards,
    Captfred

Maybe you are looking for