SSIS Convert DD MON YYYY -- DD/MM/YYYY

Hi guys trying to convert
16JAN2014 --> 16/01/2014.  Any ideas??? i'm trying to avoid the horrendous expression of ? JAN : 1 ? FEB : 2 etc. etc.
SSMS will quite happily do SELECT MONTH('16JAN2014') to get me the number of month however MONTH( "16JAN2014" ) will not work in SSIS.

Why not bring it as string in format 1 JAN 2014 and insert to sql table with datetime type? It will accept values in the format and would automatically convert it to correct date value which will be displayed as 2014-01-01 00:00:00
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Convert DD-MON-YYYY format to MM/DD/YYYY

    I have an input date variable L_DATE as 11-Aug-2013(DD-MON-YYYY).
    In my procedure, I am converting the input date to MM/DD/YYYY format .
    The logic I have used for the same in my Stored Proc- COMPARE2 is:
    R_DATE := to_char(to_date(L_DATE,'DD-MON-YYYY'),'MM/DD/YYYY');
    But this is the error that I get when the SP is run:
    ORA-01843: not a valid month
    ORA-06512: at "COMPARE2", line 51
    ORA-06512: at line 2
    Can anyone suggest how to resolve this??

    Input data doesnt match NLS_DATE_LANGUAGE setting
    Consider
    select * from v$nls_parameters
    where
    parameter ='NLS_DATE_LANGUAGE'
    PARAMETER VALUE
    NLS_DATE_LANGUAGE AMERICAN
    select
    to_char(to_date('11-MAY-2013','DD-MON-YYYY'),'MM/DD/YYYY') d
    from dual
    D
    05/11/2013
    select
    to_char(to_date('11-MAY-2013','DD-MON-YYYY','NLS_DATE_LANGUAGE=GERMAN'),'MM/DD/YYYY') d
    from dual
    ORA-01843: not a valid month
    or
    The month is not given literally
    select
    to_char(to_date('11-05-2013','DD-MON-YYYY'),'MM/DD/YYYY') d
    from dual
    ORA-01843: not a valid month

  • How to convert sysdate to the format dd-mon-yyyy

    how to convert sysdate to the format dd-mon-yyyy

    <how to convert sysdate to the format dd-mon-yyyy>
    This question is better answered by thinking about about how Oracle dates work. SYSDATE is a pseudocolumn (function without any arguments) that returns a date value: it already is a date. Oracle date values are stored not as we see them, say 'DD-MON-YY', but as a series of bytes with the different date components from the millennium down to the second. We NEVER see dates as they are stored but use the formats for automatic conversion.
    To display a date the way you want use TO_CHAR() with an edit mask or as others suggested change your NLS_DATE_FORMAT (thought I advise against this as most systems use DD-MON-YY and porting queries from other systems or even OTN can easily break). To change a converted string back to a date use TO_DATE() with an edit mask.

  • Convert varchar2 field into date formatted: DD-MON-YYYY

    Thanks in advance for anyone's help on this matter as I know it takes your time and expertise. I am pretty new to SQL but learning my way through it just have an issue with a text to date field conversion. It is an Oracle 10g database and I am writing in SQL. There is a field called Demand which is formatted in varchar2 format of ddmmyy. There is also a field that is formatted as a date called Payment which is formatted as DD-MON-YYYY.
    Essentially I need to do a simple Payment >= Demand, however as you can see that is some issue with that being a varchar2 field. Does anyone know if it is possible to do that type of expression against those two fields. Was thinking about possibly converting the varchar2 to a date but not sure how to get to that DD-MON-YYYY format.
    Also there are situations where this Demand field will often times be null as it would have never recieved any outbound correspondence in the past and would not have a date at all.
    Thanks
    Edited by: user10860766 on Aug 18, 2009 8:14 AM
    Edited by: user10860766 on Aug 18, 2009 8:19 AM

    Hi,
    It's hard to detect bad dates in pure SQL, especially if you need to be precise about when February 29 is valid.
    It's easy with a user-define function, like the one in [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3669932&#3669932].
    Edited by: Frank Kulash on Aug 18, 2009 3:50 PM
    To create a stand-alone function:
    CREATE OR REPLACE FUNCTION     to_dt
    (     in_txt          IN     VARCHAR2                    -- to be converted
    ,     in_fmt_txt     IN     VARCHAR2     DEFAULT     'DD-MON-YYYY'     -- optional format
    ,     in_err_dt     IN     DATE          DEFAULT     NULL
    RETURN DATE
    DETERMINISTIC
    AS
    BEGIN
         -- Try to convert in_txt to a DATE.  If it works, fine.
         RETURN     TO_DATE (in_txt, in_fmt_txt);
    EXCEPTION     -- If TO_DATE caused an error, then this is not a valid DATE: return in_err_dt
         WHEN OTHERS
         THEN
              RETURN in_err_dt;
    END     to_dt
    /To use it:
    SELECT  primary_key  -- and/or other columns to identify the row
    ,       demand
    FROM    table_x
    WHERE   demand          IS NOT NULL
    AND     to_dt ( demand
               , 'DDMMYY'
               )          IS NULL;

  • How to convert date  into dd mon yyyy format

    hi all,
    i have a problem in date format i am using date like below .
    <%java.util.Date date = new java.util.Date();%>
    i am inserting date into a table and its storing like this
    insert into tablename (d_date) values (date)
    and its inserting date like below
    Sun Oct 19 09:05:45 GMT+03:00 2003
    i want to fetch date in dd mon yyyy format.
    with this format i want to make a select query.i struck with the format conversion.
    how to do this.
    any comments please.
    any help

    hi all,
    i understand now where i am wrong.
    the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
    i executed the same code in a different server where date and time jones are english its working fine.
    All the problem is in regional setting and not the jsp code.
    <%
    String whtEverDateFormatYouWAnt = "dd MMM yy";
    String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
    out.print(str);
    %>
    Thanks a lot for the excellent solution.
    Thanks again.

  • Query records using a date DD-MON-YYYY in Forms 6i and 10g

    In Forms 6i, I can query records by entering >20-dec-2006 in a date field which has length of 12 with a date format mask DD-MON-YYYY in date item property. Once this form is converted to 10g, I can only enter >2-dec-2006 for querying. If trying to enter the >20-dec-2006, then, it becomes >20-dec-200 and have no record found. Although I have the date length increased to 20, the result stays the same: can't enter 2 digits for day.
    Thanks for your help in advance.

    Appreciate your help. The date field has a format mask of DD-MON-YYYY. By entering >2-dec-2005 it will automatically be displayed as >2-DEC-2005 in Forms 6i or 10g. Also, the query property has case insensitive checked as Yes. The problem is with 10g, I can not enter anything at the 12th position. I can enter the date up to the 11th position >20-dec-200. In Forms 6i, this is not a problem. Thanks.

  • Date validation in "DD-MON-YYYY" Format,

    Hi ,
    I have created a textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.

    Vaibss wrote:
    Hi ,
    I have created a textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.The call to 'to_date' is raising an exception when it tries to convert your date, standard PL/SQL exception handling takes over and the rest of your code is ignored.
    You could try:
    declare
    pragma exception_init(invalid_date,-01830);
    l_dummy date;
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    l_dummy := to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    END IF;
    exception
    when invalid_date then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    End;
    but even that will not check that the user actually used your desired format - the to_date can be quite flexible e.g. accepting separators other than the '-' that you have declared. In fact, the above would only catch the user entering a 'date' that is shorter than the format string - changing the 'invalid_date' for 'others' would capture more (all!) exceptions.
    You probably want to look at using regular expressions to perform the format validation.
    Edited by: Andy Hardy on Nov 25, 2008 12:29 PM

  • How can I change defaut date format to dd-mon-yyyy in bi analytics

    hi..
    How can I change the default date format to DD-MON-YYYY in BI Analytics...
    I am passing a date in a report from a prompt....but it is always taking "dd-mon-yyyy hh:mm:ss" format...I want to input the prompt in oracle's default date format i.e dd-mon-yyyy..
    please help...I dont want to use cast function because it will convert the date into a character value....I want a date...

    Hi USer
    Try this link
    How to change date format in OBIEE
    Re: repository variable at date prompt
    Thanks
    Diney

  • Converting Year in YYYY format for return in select list

    Using Apex 4.1.1 on Linux (Apex Listener on glassfish)
    I have a table with week ending dates and use this table for as my LOV.
    The select list comes up like 12-SEP-12 when I check the value attribute in Firebug. Problem is that this comes up as year 0012 instead of 2012 when I try to use it in my PL SQL code to save it to a table.
    Is there a way I can get the return value for the year in YYYY format for return value in select list? Have tried to_date(dt, 'DD-MON-YYYY') with no luck.
    Cheers.

    All APEX session state values are held as VARCHAR2s. Explicit conversion to and from DATE values using specified formats is recommended. Convert to VARCHAR2 in the LOV query:
    select to_char(week_ending, 'DD-MON-YYYY') l, to_char(week_ending, 'YYYY-MM-DD') v from ...and to DATE in the PL/SQL process code:
    ...to_date(:p1_week_ending, 'YYYY-MM-DD')...I'm trying to standardise on using ISO 8601 representations for non-displayed date values. These are unambiguous, sort properly using character semantics, and are compatible with other systems and technologies.

  • Date should be in this format DD-MON-YYYY  HH:MI:SS

    Hi All,
    I am having a column date data type ,in that i am using SYSDATE and formating as DD-MON-YYYY HH:MI:SS but result iam not getting in this format,any one please help me regarding this..
    Thanks in Advance..
    Edited by: 30021986 on Oct 14, 2012 1:38 PM
    Edited by: 30021986 on Oct 14, 2012 3:38 PM

    there is a misunderstanding.
    Your database column is in a DATE type. This is a type, and thanks to this type, you can DISPLAY the date in various ways in a query editor (toad, sql developer...).
    I mean, there is no various physical Date type columns, but only one called "date".
    If you want to display this date in the way "DD-MON-YYYY HH:MI:SS", then convert it into "CHAR" (or VARCHAR) type with the function TO_CHAR (in oracle).
    Example : to_char(sysdate, 'DD-MMMM-YYYY HH24:MI:SS").
    But the result will be an alphanumeric type. You won't be able to do further operation on date, like adding a day for instance.
    That's why you should keep the date format in the column of your database table, but convert it in your queries.
    If you really need to have this specified format, then use the char or varchar type in your database table.

  • Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher

    Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher where date should be displayed as date only not string.

    I've tried to use hierarchy node variables, but it seems like you can't specify a attribute of the hierarchy such as level.  So with the WBS hierarchy, if you create a hierarchy node variable, you specify the WBS value to select (If I understand this correctly).  I wish I could instead specify "give me all the WBS nodes that happen to have the value of the level attribute greater or equal to 3.  If I understand Juergens post, he is saying make security access so that only certain WBS levels can be returned in the query.  I suppose we can try that, but that would then preclude getting the level 1 and 2 in the future if the authorization is global.

  • Date validation in " DD-MON-YYYY"

    Hi ,
    I have created a textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.
    Edited by: Vaibss on Nov 25, 2008 2:09 AM
    Edited by: Vaibss on Nov 25, 2008 2:10 AM

    Hello,
    Duplicate post -
    Date validation in "DD-MON-YYYY" Format,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • How to display date in dd-mon-yyyy hh:mm am/pm format

    Hi,
    I want to display date in dd-mon-yyyy hh:mm format in OA Page. Can any body pls give me sample code that i can write in the controller.
    Regards,
    Ram

    The date format in OAF Pages is controlled by profile ICX: Date format mask.This profile can be set at site as well as user level for the individual users to set the Date format.
    But I would advice not to go for setting different profile values at user level, because i remember some old threads, where seeded Oracle pages fail, as code their is not generalised to handle date formats.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Function module to convert date form yyyy/mm/dd to mm/dd/yyyy format

    can any one tell meFunction module to convert date form yyyy/mm/dd to mm/dd/yyyy format

    hi
    good
    try this
    report zrich_0001.
    tables s002.
    data ilikp type table of likp.
    ranges: r_datum for sy-datum.
    select-options: s_spbup for s002-spbup.
    start-of-selection.
    r_datum-sign = 'I'.
    r_datum-option = 'BT'.
    r_datum-low = s_spbup-low.
    r_datum-low+6(2) = '01'.
    if s_spbup-high is not initial.
    r_datum-high = s_spbup-high.
    r_datum-high+6(2) = '01'.
    else.
    r_datum-high = r_datum-low.
    endif.
    r_datum-high4(2) = r_datum-high4(2) + 1.
    r_datum-high = r_datum-high - 1.
    append r_datum.
    select * into table ilikp from likp
    where erdat in r_datum.
    thanks
    mrutyun^

Maybe you are looking for

  • How do I change my username and email address?

    I am unable to find where to change my iTunes Store username and email address. There's nowhere on this site to be able to change it. Can I only change it through iTunes?

  • My hard drive crashed..what to do?

    Hi, My hard drive crashed..What should i do now? Is there a way for me to upload the content of my ipod to a new/blank itunes library (on my new hard drive), eventhough i understand that it usually works the other way around (itunes to ipod)? Any hel

  • I cannot drag a url to the desktop to make a shortcut anymore.

    I cannot drag a url to the desktop to make a shortcut anymore. Not with the favicon, not the url, not from the bookmarks. Nothing

  • How to: display large error note in the front panel?

    hi guys, When "error out" has an error, I would like to display HUGE RED TEXT in the FRONT PANEL saying: "STOP, ERROR DETECTED!"  ) How to do that? Thanks for your help. Solved! Go to Solution.

  • CSACS 1121 V5.4.0.46.4

    Good morning everyone, I'm Eric Jones and I'm a CISCO equipment user. I have some questions on the 1121 AAA server. We have 2, one is configured to work with our Active Directory. It access the AD data and will pull the username from the AD group; ho