Converting VARCHAR2 to a DATE type-then need month spelled out

I have a field that should be a DATE type, but is instead a VARCHAR2(8). The data in the VARCHAR2(8) field is displayed as what looks like a date -- EX: 09/18/09. I need to be able to convert the VARCHAR2(8) field so that it brings back the spelled out month plus the numeric day and year -- EX: September 18, 2009.
I've been able to successfully convert a DATE type to the needed format (September 18, 2009) using the following syntax line, but now need to convert the VARCHAR2(8):
to_char(jud_report_hear_off_v.incdate,'fmMonth dd, yyyy,') as INCDATE
Your help is appreciated!!!

So here is what worked.  I added this syntax line to my COMMAND in Crystal Reports:
       to_date(jud_report_hear_off_v.INCDATE, 'MM/DD/YYYY') as "INCDATE",
Once that line was added into the COMMAND, the new format type was now a DATE and no longer a STRING (VARCHAR2).  I added INCDATE into my report and the date appeared as 09/19/2009, as it did before, but I could now select the INCDATE field via the Format Editor and see the option to select a desired Date and Time format.  I could then change the format to the choice of spelling out the month (EX:  September 19, 2009).
Hope this helps others!  Whew!

Similar Messages

  • I want to add image in column is it possible then how to add image in data base what data type we need to do

    I want to add image in column is it possible then how to add image in data base  what data type we need to give we required any casting  please show me one example
    jitendra

    Hi again,
    Several points that can help more:
    1. If you are working with Dot.Net, then I highly recommend read the first link that you got! This is nice and simple coding. Another option is this link which is even better in my opinion:
    http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx
    2. As i mention above both link use the column's type image. There are several other option of working with Files. In most of my applications architecture I find that it is better to use a column which let us use any type of file and not an image column.
    In choosing the right column's type for your needs basically your fist question should be if if you want to store your data inside relational database environment or outside relational environment. It is a good idea to look for blogs on this issue. Next
    if you chose to store your data inside then you need to chose the right column type according to your server version. I highly recommend to look for blogs on the differences between those column's types: IMAGE, 
    Check those links:
    To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem
    http://research.microsoft.com/apps/pubs/default.aspx?id=64525
    FILESTREAM feature of SQL Server 2008
    http://msdn.microsoft.com/library/hh461480
    FileTables feature of SQL Server 2012
    http://technet.microsoft.com/en-us/library/ff929144.aspx
    Compare Options for Storing Blobs (SQL Server)
    http://technet.microsoft.com/en-us/library/hh403405.aspx
    Binary Large Object (Blob) Data (SQL Server)
    http://technet.microsoft.com/en-us/library/bb895234.aspx
    Managing BLOBs using SQL Server FileStream via EF and WCF streaming
    * Very nice tutorial!
    http://petermeinl.wordpress.com/2012/02/20/managing-blobs-using-sql-server-filestream-via-ef-and-wcf-streaming/
    [Personal Site] [Blog] [Facebook]

  • 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;

  • Function module to convert float value to data type 'dec'

    Hi experts,
      In a report i need to convert float value to the data type 'DEC'. How to convert it. Is there any function module for this conversion.
    Thanks and Regards,
    Vaibhav Tiwari.

    Hi ..
    We can do like this...
    Data : V_float type F value '12345.67'.
    Data: V_dec type P Decimals 2.
    Write:/ V_float exponent 0. "This will display it like Type P
    or
    Write V_float to V_dec EXPONENT 0.
    Write:/ V_dec.
    reward if Helpful.
    <b></b>

  • How to convert a string to date and then compare it with todays date???

    Hello.
    I want to set a format first for my dates
    DateFormate df = new SimpleDateFormate("yyyy-mm-dd");
    once this is done then I want to convert any string to date object in the above formate
    String str="2001-07-19";
    Date d = null;
    try{
    d = df.parse(s);
    }catch(ParseException pe) {
    pe.printStackTrace();
    First of all there is something wrong above,cus what I get for this is
    Fri Jan 19 00:07:00 MST 2001
    where as it should have been
    2001-07-19... to my understanding.
    once this part is done I need to get current date in the above set format and compare the
    current date and the date I set.
    I will appreciate the help.
    Thanks

    for the output part:
    a date is a point in time
    the output depends on the format you specify for output
    using for example a SimpleDateFormat.
    You only specified the format for parsing (which is independent for that of output) so java uses some default format ... see the DateFormat.format() method for details.
    for the comparison stuff, I just posted a little code snippet in this forum a few minutes ago.
    the hint is: Date.getTime() returns milliseconds after a fixed date
    hth Spieler

  • How to speicfy the Oracle SQL type VARCHAR2 in XI data type

    Hi Gurus,
    I am trying to execute an Oracle stored procedure from XI which has parameters of type VARCHAR2. How to specify these data types in data type in XI?
    I am getting the below message when I execute the stored procedure from XI with data types CHAR/VARCHAR.
    com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'TEST_PACKAGE.MAIN ' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'MAIN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    Please let me know.
    Thanks
    Kalyan

    Hi kalyan,
    i am also facing a similar issue.  the oracle stored procedure has three parameters i.e, two input paramters and 1 output paramter.
    I am passing all the parameters in the target structure, but i still get the same error.
    i have use isInput = "true" for two of the input paramters and isOutput = "true" for my output paramter.  For the output parameter, I am sending it blank.
    Please suggest.
    Thanks.
    Krishnan

  • Is there a way to show the end dates of the previous month stand out?

    is there a way to show the end dates of the previous month in bold or make it stand out? so 30,31 and 1st of this month don't all look the same? For example the 30,31st get a regular text since they are a part of the the last month and this month gets bold dates? Its hard to read the dates anyways.

    Pics and more
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    5:05 PM Sunday; January 4, 2009

  • Function module to convert character type to required data type

    Hi,
    Is there a function module which can convert data in character type to any other required data type?
    Like i have a date 12.2.2008 and it is stored as character now i want to convert it into type d.
    so that when i use
    Describe field <field_name> type <type>.
    statement afterwards then it gives me  D not C as its data type.
    The requirement does'nt stick to conversion of just one data type.I need an FM which can convert data in character type to any data type.
    Hope you understood the problem.
    Thanks for your time.

    Hi,
    Use the code.
    data : date like sy-datum.
    call function 'CONVERT_DATE_TO_INTERNAL'
      exporting
        date_external                  =  '01.01.2008'
    IMPORTING
       DATE_INTERNAL                  = date
    EXCEPTIONS
       DATE_EXTERNAL_IS_INVALID       = 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.
    Regards,
    Morris Bond.
    Reward Points if Helpful.

  • No-rounding while converting data type F to Packed

    Hi All,
    I want to pass value of a variable of data type F to another variable of dtata type P with decimals 3.
    While converting values decimals are getting rounded to next higher value.
    Can any one tell me how to retain the actual values,without rounding off.
    Ex. variable 1 = 25.1238567890000   (type F).
          when variable 2 is assigned the value of variable 1,then it should consist of the value 25.123(instead of 25.124).
    Thanks & Regards
    Seshagiri.

    Hi seshagiri,
    it seems that the value you want to pass to (type F) is smaller than the value that you are using in your code.
    Can I ask what is the actual use of the value type P? if there is processing to be done  then I suggest to try to process the needed code using a common data type then until the later parts of the logic to pass it to data type P.
    If the value is only to be used for display then just pass it to a variable of data type C or string to retain the decimals.

  • Help needed in data type casting

    I have a java program which will receive data and its type in the String format. During program execution, the data in the String data has to be converted into the respective data type and assigned to a variable of that data type so that it could be used in the program. Programmer may not know the type of data that the value has to be converted into.
    I really got struck up with this. This is a RMI application and one process node is sending the data to another node in the String format and the type of data it should get converted into so that it can be converted into the respective type and used for computation.
    Can you understand what I am asking for ....if you can pls help and it is highly appreciated

    I dont know whether i ahve expressed it correctly
    look at this code
    dataPacket sendtoNode = send.senDatatoNode(inputReq);
    String recnodnum = sendtoNode.nodeNum;
    String recvarnum = sendtoNode.varNum;
    String recvartype = sendtoNode.dataType;
    String recvalvalue     = sendtoNode.dataVal;
    int num;     int type;
    double result;
    // here in this case the result variable type is double
    if (recvartype.equals("int")){
              type = 1;
         result = Integer.parseInt(recvalvalue); will pose problem
         else
         if (recvartype.equals("double")){
              type = 2;
              result = Double.parseDouble(recvalvalue);
         else
         if(recvartype.equals("float")){
              type =3;
              result = Float.parseFloat(recvalvalue); will pose problem
         else
         if(recvartype.equals("Boolean")){
              if ((recvalvalue.equals("true")) || (recvalvalue.equals("TRUE")))
              type = 4;
              result = Boolean.parseBoolean(recvalvalue); will pose problem
         else
         if(recvartype.equals("char")){
              type = 5;
              result = (char)recvalvalue; will pose problem
    else
    if(recvartype.equals("String")){
         type = 6;
              result = recvalvalue; will pose problem
         else
         if(recvartype.equals("byte")){
              type = 7;
              result = Byte.parseByte(recvalvalue); will pose problem
         else
         if(recvartype.equals("long")){
              type = 8;
              result = Long.parseLong(recvalvalue); will pose problem
         else
         if(recvartype.equals("short")){
              type = 9;
              result = Short.parseShort(recvalvalue); will pose problem
         //forvarval varvalue = new forvarval();
         //varvalue.forvarval(recvartype, recvalvalue);
    // this has to be done after sorting the problem of type casting string result = recvalvalue;
    //result = value; //<this will surely give me a problem as i m assigning string to double>??
    send.host(result);
    System.out.println("result received and the result is " +recvalvalue );
    now i need to assign the converted string in to a variable and use in the compuation ..thts where the challenge n not in teh conversion process...

  • Cannot convert between unicode and non-unicode string data types.

    I'm trying to copy the data from 21 tables in a SQL 2005 database to a MS Access database using SSIS. Before converting the SQL database from 2000 to 2005 we had this process set up as a DTS package that ran every month for years with no problem.  The only way I can get it to work now is to delete all of the tables from the Access DB and have SSIS create new tables each time. But when I try to create an SSIS package using the SSIS Import and Export Wizard to copy the SQL 2005 data to the same tables that SSIS itself created in Access I get the "cannot convert between unicode and non-unicode string data types" error message. The first few columns I hit this problem on were created by SSIS as the Memo datatype in Access and when I changed them to Text in Access they started to work. The column I'm stuck on now is defined as Text in the SQL 2005 DB and in Access, but it still gives me the "cannot convert" error.

    I was getting same error while tranfering data from SQL 2005 to Excel , but using following method i was able to tranfer data. Hopefully it may also help you.
    1) Using Data Conversion transformation
       data types you need to select is DT_WSTR (unicode in terms of SQL: 2005)
    2) derived coloumn transformation
       expression you need to use is :
        (DT_WSTR, 20) (note : 20 can be replace by your character size)
    Note:
    Above teo method create replica of your esting coloumn (default name will be copy of <coloumn name>).
    while mapping data do not map actual coloumn to the destination but select the coloumn that were created by any of above data transformer (replicated coloumn).

  • How to convert Date type

    I have a JSP to read the date value and use it to update the corresponding column in the table. In the JSP, the data type returned from request.getParameter("hiredate") is java.util.Date. Unfortunately, the CachedRowSet requires the java.sql.Date type. How can I convert the java.util.Date type to java.sql.Date type? Please advise,thanks.
    SK

    SK,
    This is how I do it:
    java.util.Date utilDate = new java.util.Date();
    long millis = utilDate.getTime();
    java.sql.Date sqlDate = new java.sql.Date(millis);Good Luck,
    Avi.

  • Convert from String data type to Character data type

    Hi...,
    I'm a beginner. I try to make a program. But I don't know how to convert from string to data type. I try to make a calculator with GUI window. And when somebody put "+" to one of the window, I just want to convert it to Character instead of String.
    Sorry of my bad english..
    Please help me....
    Thanks

    String s = "a+b";
    char theplus = s.charAt(1);

  • How to retrieve the data type of a column of a table?

    Hi,
    I want to retrieve the data type of a column of a table. At the moment I am querying "OCI_ATTR_DATA_TYPE" attribute but it is returning SQLT_CHR for both varchar2 and nvarchar2 data type columns. I need to distinguish between these two data types columns separately. Is there any API through which I could get the exact data type of a column i.e. "nvarchar2"?
    Thanks in advance.
    Hashim

    Hi,
    This is the Oracle C++ Call Interface (OCCI) forum - I'm not sure if you are using OCCI or OCI (Oracle Call Interface - the C interface) since you reference "OCI_ATTR_DATA_TYPE" which is more of an OCI focus than OCCI.
    In any case, you might take a look at "OCI_ATTR_CHARSET_FORM" which takes the following values:
    #define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
    #define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */So, if you have a datatype of SQLT_CHR and OCI_ATTR_CHARSET_FORM is SQLCS_IMPLICIT then you have a varchar2 if it is SQLCS_NCHAR then you have an nvarchar2.
    If you are using OCCI and not OCI then take a look at MetaData::ATTR_DATA_TYPE and MetaData::ATTR_CHARSET_FORM which expose OCI_ATTR_DATA_TYPE and OCI_ATTR_CHARSET_FORM respectively.
    Perhaps that will get you what you want.
    Regards,
    Mark

  • Evaluate function to convert presentation variable to date not working..

    Hi,
    I have a calendar prompt on my dashboard and the presentation variable for this prompt is PV1.
    I am using this variable in my report to create a calculated column. The condition for the calc column runs something like
    case WHEN "Time"."Day" >= ANY(SELECT saw_3 FROM(SELECT "Time"."Start Date" saw_3 FROM "xyz_subject_area" WHERE "Time".Day = CAST(EVALUATE('TO_DATE(%1,%2)' AS DATE, '@{PV1}{@{system.currentTime}[MM/DD/YYYY]}', 'MM/DD/YYYY HH:MI:SS AM' ) AS DATE)) EX1) then "ABC"."Units" else "XYZ"."Units" end
    However when I checked the expression EVALUATE('TO_DATE(%1,%2)' AS DATE, '@{PV1}{@{system.currentTime}[MM/DD/YYYY]}', 'MM/DD/YYYY HH:MI:SS AM' ) is not returning the date always. I am not sure why for some rows it is working correctly and for some it is not returning any value.
    Please let me know if there another better way to convert the presentation variable value to date.

    Hi User,
    What is the data type of the column you are using in the prompt?
    I think a datetime data type will by default cause OBIEE to wrap the presentation variable in the TIMESTAMP syntax if you just do this '@{PRESENTATION_VAR}'.
    If you, did not base it on the datetime data type, then try the following:
    cast( LEFT( '@{MY_DATE}' ,4 ) || '/' || SUBSTRING( '@{MY_DATE}' FROM 6 FOR 2) || '/' || SUBSTRING( '@{MY_DATE}' FROM 9 FOR 2)||' 00:00:00' as date)
    In order to use OBIEE to cast as a DATE, your string needs to be in the form YYYY/MM/DD HH24:MIN:SS
    Good luck!
    -joe

Maybe you are looking for

  • If statement to put "Yes" or "No" in a table cell on another page

    Hello I have tried to find a solution to this and I just can't figure it out. I have gone through all of the messages and tried the examples and no go. Please help, thanks. THIS IS WHERE THE RADIO BUTTON IS: ----- form1.BorrowerInput.OtherPaymentsGro

  • Making galleries, advice please.

    Hello all, I have built a website which has in it a gallery page in which are several albums, each album holding around 20 to 30 pictures. So far what I have done is made a main gallery page which has links to separate album pages. On each album page

  • [SOLVED] pacman -Qdt shows required packages

    I've used "pacman -Qdt" quite often but since yesterday it shows packages that it probably should not: autoconf2.13 hal pm-utils pm-quirks hal-info dmidecode consolekit xorg-server-xvfb yasm If I remove "orphans" like pm-utils or hal, I will only kno

  • Colors showing incorrectly after convert

    Hi, I edited my CR2 pictures in Lightroom. After converting to any format the colors were colder than in original image. I opened it in Photoshop, Irfanview and Firefox. In Lightroom the image looked same as original. Both Lightroom and Photoshop are

  • Open or Save WolAuthenticationHandler.json

    Hi, On my fresh install of Windows 8 which is upgraded to 8.1, I see below prompt when I browse some sites: "Do you want to open or save WolAuthenticationHandler.json from windows.microsoft.com?" Some of those sites are famous sites and I have browse