How to use quarter format in "to_date()" function?

Hi,
I'm trying to use to_date() function with quarter format. How do I specify the format?
For example to convert '2002 quarter 1' using the to_date function.
I tried to_date('20021', 'YYYYQ'), and I got ORA-01820 cannot appear in date input format.
Please help, thank you!!!

You cannot use Q when inputting data, only when retrieving data. When inputting, you must enter a valid date. Oracle has to store a date and if you just enter a quarter, it can't figure out what date to store. See the examples below:
SQL> -- test table:
SQL> CREATE TABLE test_table
  2    (test_date DATE)
  3  /
Table created.
SQL> -- the wrong way to input:
SQL> INSERT INTO test_table (test_date)
  2  VALUES (TO_DATE ('2002-1', 'YYYY-Q'))
  3  /
VALUES (TO_DATE ('2002-1', 'YYYY-Q'))
ERROR at line 2:
ORA-01820: format code cannot appear in date input format
SQL> -- the right way to input:
SQL> INSERT INTO test_table (test_date)
  2  VALUES (TO_DATE ('27-OCT-2002', 'DD-MON-YYYY'))
  3  /
1 row created.
SQL> -- to output:
SQL> COLUMN "Year and Quarter" FORMAT A16
SQL> SELECT test_date,
  2         TO_CHAR (test_date, 'YYYY-Q') AS "Year and Quarter"
  3  FROM   test_table
  4  /
TEST_DATE   Year and Quarter
27-OCT-2002 2002-4
1 row selected.

Similar Messages

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Need an example how to use SCAN_Start with a callback function

    I would appreciate if someone helps me with a working example of how to use SCAN_Start with a callback function. I need just a basic functionality: to specify a channel list (with gains probably), to start a data acquisition task and to receive data buffers utilizing a callback function. t this time whatever I was trying to do caused computer hangups, though it is supposed to be one of the most regular tasks to perform.
    Thank you in advance,
    Mike

    Hello Mike,
    Thank you for contacting National Instruments.
    Attached is an example project which uses a callback function to begin analog acquisition (AI) by calling SCAN_Start. This project acquires from the first 2 channels on your DAQ device. Make sure to modify the device number in the code to match the number of your card.
    Let me know if you have any further questions...
    Sincerely,
    Sean C.
    Applcications Engineer
    National Instruments
    Attachments:
    Acquire_multichannel_61xx.zip ‏11 KB

  • How to use string format in TextInput?

    How to use string format in TextInput?
    Ex.
    HH:MM:SS when typing message appear in 12:34:56 form.
    N,NNN when typing message appear in 1,234,567 form.

    look up for "Using formatters" in the FB help.
    Essentially you'll instantiate a format, NumberFormatter for
    numbers for example, and set it's properties like e.g. showing a
    thousand separator and then one some event of the TextInput --
    valueCommit for example -- you'll do something like:
    ti.text = nf.format(ti.text)
    this is would also give you opportunity to validate user
    input using the same formatter and valid event.
    ATTA

  • How to use a mysql built-in function with dataprovider

    hi.
    I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
    Something like this doesn't work:
    MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
    How should it be done?
    thanks.
    Mike.

    hi.
    thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
    best regards.
    Mike.

  • How to use parameters in smartform genrated  function module

    i executed smartform one functional module is genrated  '/1BCDWB/SF00000002'
    now the problem is that  i want to send  output of this smartform through email
    now how to use ' MAIL_RECIPIENT   '      and  ' MAIL_SENDER   ' to send smartform output through email .
    please check following module which generated by smartform.
    plz suggest me  .
    CALL FUNCTION '/1BCDWB/SF00000002'
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        ITAB_PA0001                =   ITAB_PA0001
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Hi
    You can do it while passing these parameters in the CONTROL_PARAMETERS.
    data: ls_CONTROL_PARAMETERS type SSFCTRLOP.
    ls_CONTROL_PARAMETERS-DEVICE  = 'LOCL'.
    ls_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
    ls_CONTROL_PARAMETERS-PREVIEW = ' '.
    Pass this ls_CONTROL_PARAMETERS to the importing parameter of the FM .
         CALL FUNCTION LF_FM_NAME
               EXPORTING
                          CONTROL_PARAMETERS   = LS_CONTROL_PARAM
    In addition to this, you might also want to set the print immediately field on the same structure to 'X'.
    Generally you leave the device field empty, the user master record default printer will be used

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • How to use CSV format in making a data connection.

    Hello All,
    I have got a form to develop. There are over 1000 entries to be imported. Can I use CSV format to embed those data in the forms. Mainly those data would be embedded as dropdowns.If I can use how to do it ? If i can not use is there any better way without using the Database like MySQL or something.
    Thanks.
    Bibhu.

    Hi Afroz,
    To be more specific, if the csv file doesn't has header, please refer to this script to add header:
    $csv = Import-Csv d:\haha.csv -Header "UserA","UserXYZ","EmailA"
    Then you can loop this csv file to run the "add-mailboxpermission" cmdlet, I recommend you can test this script before running against production environment, please also note I haven't tested this script:
    $csv = Import-Csv d:\users.csv -Header "UserA","UserXYZ","EmailA"
    foreach($each in $csv){
    write-host "assign fullaccess permission of user $($each.UserXYZ) on mailbox $($each.EmailA)"
    get-mailbox -identity $each.EmailA | add-mailboxpermission -user $each.UserXYZ -accessrights 'fullaccess'
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to use currency format set

    Hi All,
    I have to use currency format set to mask the amount values to their respective currencies ,
    i reviewed the Oracle XML Publisher Administration and Developer's Guide and followed all the steps mentioned there ,i m also quoting the same over here
    To define a Currency Format Set:
    1. Navigate to the Currencies page under the Administration tab. Select Create
    Currency Format Set.
    2. Enter a Name and a Code for the set. The Code is a unique identifier and cannot be
    changed later. Select Apply.
    3. The Currency Formats page will display for your newly created set.
    To add currency formats to the Currency Format Set:
    1. Select Add Currency Format to add a format to your set.
    2. Select a Currency Name from the list.
    Note: This list is generated from the FND currency table and
    should include all ISO currencies. Additional currencies can be
    added from the System Administrator responsibility.
    3. Enter the Format Mask you wish to use for this currency and select Apply.
    The Format Mask must be in the Oracle number format. The Oracle number format
    uses the components "9", "0", "D", and "G" to compose the format, for example:
    9G999D00 where
    9 represents a displayed number only if present in data
    G represents the group separator
    D represents the decimal separator
    0 represents an explicitly displayed number regardless of incoming data
    See Using the Oracle Format Mask, Oracle XML Publisher Report Designer's Guide for
    more information about these format mask components.
    After a currency format has been created, you can update or delete it from the Currency
    Formats page.
    i followed all the above step ,i need to use germany currency ,i have also used the format-currency command in my RTF template,but still its not working ,i used 9G999D00 for masking .
    Any hint would be very helpful ,thanks in advance .Please let me know if my question is not clear
    Thanks
    Pratap

    hi all
    Thanks ,this is resolved ,i just missed clearing cache ,after clearing the cache its working .
    thanks
    Pratap

  • How to use a Logical Database in Function Module.

    Hi Experts,
    I want to use a logical database in a Function Module to fetch data from a standard SAP table into a Internal table for certain filter conditions.
    How can I get get this done????
    I called LDB_PROCESS FM in my FM, but I could not figure out how to store the extract in my IT table since we cant use GET in FM.
    Please provide me a sample code if possible.
    Thanks in Advance,
    Alex.

    Hi,
    i had an example program like this ,in this i want to get the data using pnp logical database with 5 fields in an interface program.
    data: begin of it_final occurs 0,
            pernr like pa0002-pernr,
            vorna like pa0002-vorna,
            nachn like pa0002-nachn,
           usrid like pa0105-usrid,
           usrid_long like pa0105-usrid_long,
           end of it_final.
    get pernr.
      clear : p0000,p0002,p0105.
      rp-provide-from-last p0000 space p_date p_date.
      if p0000-stat2 = '3'.
        v_pernr = pnppernr-low.
      else.
        reject.
      endif.
    *---Get employee pernr, First name ,Last name into final table
      rp-provide-from-last p0002 space p_date p_date.
      if pnp-sw-found = '1'.
       it_final-pernr = p0002-pernr.
       it_final-vorna = p0002-vorna.
       it_final-nachn = p0002-nachn.
      else.
    *---Error message if not infotype 0002 maintained
      T_ERROR-PERNR   = pnppernr-low.
      CONCATENATE TEXT-EMI '0002'
      INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
      APPEND T_ERROR.
      CLEAR T_ERROR.
      endif.
    **--Get SYSTEM USERNAME to final table
      rp-provide-from-last p0105 0001 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid = p0105-usrid.
      else.
    *---Error message if not SYSTEM USERNAME maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-003 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
    **--Get Email ID to final table
      rp-provide-from-last p0105 0010 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid_long = p0105-usrid_long.
      else.
    *---Error message if not Email ID maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-004 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
       append it_final.
        clear it_final.
    reward points if useful,
    venkat.

  • How to use multiple models in one Function module?

    Hi,
    In my FM i am using 2 models and if i dont completely exit the Function and use the same fm for another query based on another
    model it is giving error saying invalid type.
    if iv_type_of_search = 'A'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
    Contact Search
      elseif iv_type_of_search = 'C'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BP_APPL' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilContactAdvancedSearch' ).
    *Opportunity Search
      elseif iv_type_of_search = 'O'.
    start the application BT
        lv_bol_core = cl_crm_bol_core=>get_instance( ).
        lv_bol_core->start_up( 'BT' ).
    get an instance of dynamic opporunity query
        lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQOpp' ).
      endif.
    Any idea how to over come this or remove the instance of the old query and model every time its run?
    it looks like the object of the last run is still there and i cant find any destructor method or way and
    if i exit se37 it works fine....

    Hi George,
    You can also set up your model (component set) with the components you need.
    Check it on:
    SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Basic Settings
    Kind regards,
    Garcia

  • How to use multiple formats in one JFormattedTextField

    Hi,
    I am looking for a way to allow multiple formats in the same JFormattedTextField. Let's say I want to allow input like:
    a) 123-AB-123
    and
    b) AB-12345-CD
    Of course I could use an InputVerifier of my own combined with regular expressions to see if the input matches. But I like the way JFormattedTextField supports the UserInput by displaying a Placeholder String. So the User sees what the input might look like.
    I'd tried to write a FormatterFactory of my own, which will return either a MaskFormatter for a) or b) but the JFormattedTextField checks out the Formatter only when gaining or loosing focus. What should happen is that it checks out the formatter after each keystroke.
    Does anyone know a solution for this or how I could force the FormattedTextField to REget it's formatter?
    Thanks
    Thimo

    Check out the following; it provides code for a regular expression formatter:
    http://java.sun.com/products/jfc/tsc/articles/reftf/
    Unfortunately, this does not support the 'placeholder' notion like the MaskFormatter does, if that's what you were talking about. I'm not sure how you could cobble them together, since with the MaskFormatter you don't have to type the mask literal characters, but you would need to with the regular expression.
    : jay

  • How to use Special Characters in CONCAT function or another form with Xquer

    Hello everyone
    I'm using PS3 OEPE within message flow (proxy)and I'm using Xquery.
    I'm using the CONCAT function, but this does not allow me to concatenate special characters not allowed, for example:
    I want to concatenate these strings:
    String1 = “&amp;lt;get-person&amp;gt;&amp;lt;id-person&amp;;gt;”
    String2 = “123”
    String3 = “&amp;lt;/id-person&amp;;gt; &amp;lt;/get-person&amp;gt;”
    I want to represent characters regex. It means no XML characters
    Someone knows some way, any function that allows me to concatenate in OSB these values with Xquery?
    Edited by: chromosoma on Sep 5, 2012 5:59 PM

    Hi,
    It seems to me you're doing things in the most complicated way possible...
    Firstly, you should use codepoints-to-string not the reverse... Secondly, the function work with decimals, not hexa
    http://www.xqueryfunctions.com/xq/fn_codepoints-to-string.html
    http://www.xqueryfunctions.com/xq/fn_string-to-codepoints.html
    This works...
    concat(codepoints-to-string(38),'lt',codepoints-to-string(59),'get-person')But this also works... Note that I've inserted a space between the &amp; and the lt so the forum formatting can show it...
    let
    $String1 := "& lt;get-person& gt;& lt;id-person& gt;",
    $String2 := "123",
    $String3 := "& lt;/id-person& gt;& lt;/get-person& gt;"
    return
         concat($String1,$String2,$String3)And, finally this also works... So what's the reason for escaping &lt; and &gt; with &amp;lt and &amp;gt; and why codepoints?
    let
    $String1 := "<get-person><id-person>",
    $String2 := "123",
    $String3 := "</id-person></get-person>"
    return
         concat($String1,$String2,$String3)Cheers,
    Vlad

  • How to use many format data into a template?

    How to design a template but it can interface from many format data? 

    This is the one from 2010 but should still work.
    http://www.bfcnetworks.com/blogs/alexpearce/pull-sharepoint-2010-document-properties-into-word-quick-parts/
     You basically create a new document in the library (must have the columns you want into the word document), then you use the Quick
    Parts to insert the data where needed. Then you save this document as your template. Then anytime someone creates a document in the library when you open the document it will read from the columns of the item.
    I used a workflow and had the users actually update a SharePoint list, then that in turn creates a new document in the document library and populate the columns from the list form. Then You can send that document link to folks to download / print or whatever.
    Is that what you are talking about?

  • How to use StreamTransformationException in user-defined function?

    Hi,
    I'm doing a DBLookup (using Java pgm in one of my Imported Java archives) for populating one of the fields in message mapping. If the DB connection fails, I want to terminate the mapping by throwing a StreamTransformationException from within a user-defined function.
    I require urgent help in this regard.
    Thanks in advance.
    Regards,
    Sridhar Rajan N

    Hi,
    I had the same problem. I failed to find the way how to throw a StreamTransformationException in my user-defined function. But I used another exception: NullPointerException. Yes, I know, this is not an elegant solution...
    Best regards,
    Andrzej Filusz

Maybe you are looking for

  • About routing text read using fm CP_EX_PLAN_READ

    Hi, I am writing a program to copy routing from one plant to another. Everything works great except for long text. I did search the forum but could not find any helpful tips. 1>  I am reading the routing using fm CP_EX_PLAN_READ        CALL FUNCTION

  • $1 Charged for Free Trail

    Dear Azure users, I'm trying to register for Azure Free Trail. I was asked for credit card info and it mentioned as its for identification purpose only. But, still I was charged by 1 USD. Its something weird service from Microsoft. They should have m

  • No support for fuji x, no support for dp merrills, no nikon d7100 ( probably to early)

    I am really wondering if Apple will end develop aperture in the future. Adobe is so much faster and recently also capture one has overtaken aperture in terms of raw support. a kingdom for a good support of foveon files.

  • Sales Text

    Hi All,   I am working on Invoice Smartform ZLB_BIL_INVOICE.   In output i want to display sales text which is in MM02.For that i use include text in smartform in which i want to define TEXT NAME  Material sales organisation distribution Ch TEXT OBJE

  • Auto populate iChat buddy picture to Address Book?

    I don't know if this is really an Address Book question, or an iChat AV question, but here goes: I am trying to have the buddy picture that my friends use with their iChat or AIM screen name transfer over to Address Book. Right now, I see their buddy