Date Format in 'HH:MI' - help needed

I have a table details that contains time_status column of Timestamp datatype.
Data is stored in the column in the format '1/1/2008 10:31:00.000000 AM'.
Now I want to select the data in HH:MI fopmat only.
i.e., for '1/1/2008 10:31:00.000000 AM' I should get 10:31.
I have written as select to_char(time_status,'HH:MI') from dual;
I am getting an error when this query is included in the procedure.
When I am executing outside, its is working.
Also, How can I get the format a '1/1/2008 10:31'.
Thanks in advance.
Regards
Raghunadh.

I have a table details that contains time_status column of Timestamp datatype.Good. Always use the correct datatype. Either date or timestamp.
Data is stored in the column in the format '1/1/2008 10:31:00.000000 AM'.
Wrong! A timestamp or also a date column has no format! Same as a number column has no format.
Now I want to select the data in HH:MI fopmat only. i.e., for '1/1/2008 10:31:00.000000 AM' I should get 10:31.When you work with date and timestamps you don't need any format. When you display the value, then you need to change your date into a string. Only during this transformation formatting takes place.
Example:
SQL*Plus: Release 9.2.0.2.0 - Production on Thu Aug 21 10:45:17 2008
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
/* lets do a simple date select */
SQL> select sysdate from dual;
SYSDATE
21-AUG-08
"Attention!" Sql*Plus did an implizit date to string conversion to show this value on the screen.
It used the NLS settings for the format.
/* Now lets change the nls settings */
SQL> alter session set nls_date_format = 'FMddth Month YYYY';
Session altered.
SQL> select sysdate from dual;
SYSDATE
21st August 2008
SQL>
"Different output for the same query! Value is the same, only the formatting was changed."
I have written as select to_char(time_status,'HH:MI') from dual;You should ask yourself, why do I want this string?
I am getting an error when this query is included in the procedure.
When I am executing outside, its is working.
Also, How can I get the format a '1/1/2008 10:31'.Check the documentation (sql manual) for the many options for the date format settings. Also check for timestamps, they are a bit more difficult to handle than dates.
Thanks in advance.
Regards
Raghunadh.You're welcome.

Similar Messages

  • Date format not recognized -- urgent help needed

    Hi,
    I'm having a problem when start sqlplus in dos command window. If I start it from C:\oracle\ora81\bin, it won't started and error message showing like 'Date format not recognized' and then come back to DOS.
    I do have OWB installed which also has SQLPLUS installed so that there is no problem if I start it from C:\ORACLE\owb92\bin.
    For some reason, the path is setting as C:\oracle\ora81\bin before C:\ORACLE\owb92\bin so the default always goes to 81 folder.
    If restart the DB instance, and this problem is gone. But it comes back after some application running (our own application and Oracle provided OMBPlus ). We double check our own application, and there is no where to "alter session ...".
    Any help will be very appreciatged,
    Thanks,
    Daming

    I'm having a problem when start sqlplus in dos command window. If I start it from C:\oracle\ora81\bin, it won't started and error message showing like 'Date format not recognized' and then come back to DOS.
    Do you have a file called 'login.sql' in the folder 'C:\oracle\ora81\bin'? If there is one, is there an 'alter session' command in this file?

  • Photo format correction... help needed

    Hi I'm new to the forum so please forgive me if I in the wrong section. I'll explain my problem as best as I can. I have taken some photos of text books in a library, the photos aren't the best quality because I was in a hurry and the library rules forbid photos being taken so most of them are not straight, a bit blury or taken at the wrong angle (star wars film intro text style!!). I needed to convert these jpegs to doc format or PDF but since the texts shown in the photos are not perfectly straight or clear I was wondering if any one can give me some step by step instructions using photoshop CS6 as how to get the texts in the photos straight and clear enough to be able to convert them correctly to .doc or pdf formats.
    thanks for any help at all
    J.

    I should have explained myself better... most of the books in this library for some reason aren't for loan, you can't take them out of the library, they will do photocopies at an abnormal cost so someone who has to study for a uni degree and needs hundreds and hundreds of pages... would definitely never pay such an amount for photocopies... hence breaking the library rules. Most of the books in this library are of historical importance and can only be found in libraries that will charge you to the bone for photocopies.
    That said, can anyone help me out with correcting the photos using photoshop CS6 so that I can convert them to doc or pdf files successfully?
    thanks

  • Date format error in Search help

    Hi,
    I am using standard search help in my ABAP webdynpro application.It is related to payscale group (field P0008-TRFGR). It works fine if I do not specify any date but gives a error message "Enter date in the format __.__.____ "   irrespective of the date format I use to enter.
    Any pointers ?
    Regards
    Deepak

    Hi Deepak,
    Try following things:
    1) check separator / instead of .
    2) date in format mm.dd.yyyy or dd.mm.yyyy
    3) enter date through search help
    4) enter 0 before one digit month or day i.e. 02/02/2009 instead of 2/2/2009
    Regards,
    Saket.

  • How to convert date format in XI? Help!

    Hi Experts,
    PIP is the input for XI.
    The PIP has date as : <DateTimeStamp>20030515T000000.000Z</DateTimeStamp>.
    How to convert it into MM/DD/YYYY format in XI? 
    Thanks
    Gopal

    hi,
    use two standard functions:
    <b>substring </b>(to take first 8 chars from this field)
    <b>DateTrans</b> to change 20030515 to MM/DD/YYYY
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    that's all you need to do very simple
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Function... to capture data in worksheet  to table help needed

    hi,
    I am new to this field, i need a sample code, for the following
    A function1 should capture data elements like 3 to 4 values from discoverer worksheet1 and those values must me transfered to dummy tables..
    The data in the dummy tables should be deleted once it is being captured by Function2
    Other function2 should capture those data from dummy tables and pass it to other worksheet2. the result on the worksheet 2 will be based on the data in the dummy tables
    It would be really helpful, if i get a sample code for this process..
    regards
    -Seetha.

    Hi Sabine,
    I created a worksheet 1, which shows the amount of all
    customers for Quater1, Quater 2, Quater3 and Quater 4.
    And in the end it will show total amount for Quat1,
    Quat2,Quat3 and Quat4.
    eg.
    CUSTOMER     Quat1     Quat2     Quat3     Quat4
    abcd          100     10     200     300
    zaqws          10     230     90     60
    qwer          400     250     300     100
    Total          510     580     590     460
    This Four Values in total
    Quat1_Total = 510
    Quat2_Total = 580
    Quat2_Total = 590
    Quat2_Total = 460
    These four amounts has to be transfered to worksheet 2..
    the output of the worksheet 2.. depends on these 4
    values.
    1. How should i captures these four values and pass it
    to worksheet 2?
    2. Should I have to use function? if so how?
    I need sample code for it.. since i am new to this field.
    3. Depending up on the result on worksheet 1 , worksheet2
    has to provide results like.. comparing with last
    quaters...etc..
    Thanks in Advance
    -Seetha

  • Mail to RFC -- Data Structed in Inbound Queue  -- Help needed !

    Hi Friends ,
                           I am doing Mail to RFC Asyn Scenario . Mail mails are come into the mail box . XI is trying to read the mail and send to R3.
                            It was working fine suddenly , Many mails read succesfully and data send to RFC , But it is structed in   ( SMQ2 ) inbound Queue ( <b>Message Scheduled on Outbound side</b> )
                  For long time it is showing like this . No data is accepted  by RFC. I have checked the Adpater confi for rfc it is fine .  I have given Max connection as 50 also .
              Please help me to solve this issue !
    Regards.,
    V.Rangarajan

    Hi,
    Have the Queues being registered in the R/3..?
    If not....
    1.Go to SXMB_ADM(R/3)
    2. Go to Manage Queues and then
    3. Register All Queues.
    <a href="/people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically Failed Messages</a>
    Regards
    San
    <a href="Remember to set the thread to solved when you have received a solution to set the thread to solved when you have received a solution</a>
    Where There is a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/weblogs/topic/16">blog</a> there is a Way.

  • Error: No batch input data for screen SAPMZVKDIALOGDEMO 1000 Help Needed

    Hi Experts!
    I wrote a program for BDC. I am attaching the code herewith. When i am trying to process the session in SM35, i was getting the error: No batch input data for screen SAPMZVKDIALOGDEMO 1000. Can anyone please tell me, what am i doing wrong.
    Thanks.
    REPORT  zvkbdcdemo01.
    DATA: bdc_tab LIKE bdcdata OCCURS 6 WITH HEADER LINE.
    DATA: session LIKE apqi-groupid VALUE 'Session #1'.
    CALL FUNCTION 'BDC_OPEN_GROUP'
      EXPORTING
        client                    = sy-mandt
    *   DEST                      = FILLER8
        group                     = session
    *   HOLDDATE                  = FILLER8
    *   KEEP                      = FILLER1
        user                      = sy-uname
    *   RECORD                    = FILLER1
    *   PROG                      = SY-CPROG
    * IMPORTING
    *   QID                       =
    * EXCEPTIONS
    *   CLIENT_INVALID            = 1
    *   DESTINATION_INVALID       = 2
    *   GROUP_INVALID             = 3
    *   GROUP_IS_LOCKED           = 4
    *   HOLDDATE_INVALID          = 5
    *   INTERNAL_ERROR            = 6
    *   QUEUE_ERROR               = 7
    *   RUNNING                   = 8
    *   SYSTEM_LOCK_ERROR         = 9
    *   USER_INVALID              = 10
    *   OTHERS                    = 11
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM fill_bdc_tab.
    CALL FUNCTION 'BDC_INSERT'
      EXPORTING
        tcode                  = 'ZVKTR001'
    *   POST_LOCAL             = NOVBLOCAL
    *   PRINTING               = NOPRINT
    *   SIMUBATCH              = ' '
    *   CTUPARAMS              = ' '
      TABLES
        dynprotab              = bdc_tab
    * EXCEPTIONS
    *   INTERNAL_ERROR         = 1
    *   NOT_OPEN               = 2
    *   QUEUE_ERROR            = 3
    *   TCODE_INVALID          = 4
    *   PRINTING_INVALID       = 5
    *   POSTING_INVALID        = 6
    *   OTHERS                 = 7
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    * EXCEPTIONS
    *   NOT_OPEN          = 1
    *   QUEUE_ERROR       = 2
    *   OTHERS            = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  fill_bdc_tab
    *       text
    FORM fill_bdc_tab.
      REFRESH bdc_tab.
      PERFORM populate_bdc_tab USING:
      '1' 'SAPMZVKDIALOGDEMO' '1000',
      ' ' 'SFLIGHT-CARRID' 'LH',
      ' ' 'SFLIGHT-CONNID' '0400',
      ' ' 'SFLIGHT-FLDATE' '07/07/2007',
      ' ' 'SFLIGHT-PRICE' '1982',
      ' ' 'SFLIGHT-CURRENCY' 'EUR',
      ' ' 'SFLIGHT-PLANETYPE' 'A310-300',
      ' ' 'BDC_OKCODE' 'CREA'.
    ENDFORM.                    "fill_bdc_tab
    *&      Form  POPULATE_BDC_TAB
    *       text
    *      -->FLAG       text
    *      -->VAR1       text
    *      -->VAR2       text
    FORM populate_bdc_tab USING flag var1 var2.
      CLEAR bdc_tab.
      IF flag = '1'.
        bdc_tab-program = var1.
        bdc_tab-dynpro = var2.
        bdc_tab-dynbegin = 'X'.
      ELSE.
        bdc_tab-fnam = var1.
        bdc_tab-fval = var2.
      ENDIF.
      APPEND bdc_tab.
    ENDFORM.                    "POPULATE_BDC_TAB

    This normally means that you are trying to insert data on a screen for which a particular field is not available.
    So check screen number, screen fields and report name. In case of screen fields, use F1, F9 (technical information), and check the name of the screen field for batch processing (all the way at th bottom of the pop-up). This can differ from actual name of the screen field.
    If all this is ok, try to create a recording of the transaction with SM37.

  • PDF Print Forms - Date format

    Hi Frnds,
    This is my first time to work in PDF print forms.
    I am using standard interface and program to print my PDF forms. The PDF form alone is customised.
    I need to format my date as dd-mmm-yyyy. how can i do it?
    can i call a subroutine from a Zprogram in the context or interface?
    Can anyone help me to solve my issue? thanks a lot.
    regards
    Suganya.

    Hi Frnds,
    I got the date format solution.
    But I need to know whether we can use the subroutine of the program inside the interface or PDF forms as like script.
    I am using the std prgm RFKORD10_PDF and my customised PDF form. but i am getting an error as "Contradiction in form".
    Can anyone help me to solve the error?
    thank in adv
    Suganya

  • Formating string to date format in vc

    hai,
    function module in production return a date in type of char10. now i need to convert into proper data format.
    can any one help me.

    data: l_date type datum
          , l_d(10)
    l_date = sy-datum.
    write l_date to l_d. -> This statement will convert into user date format
    write:/ l_d.  
    ...Naddy

  • Regarding Date format in Reports.

    Hi All,
    I want to change the Date format in BEx reports. Currently I am getting MM DD YYYY. But I need it as DD MM YYYY. I had gone thru numerous posting on this issue. I changed the Date Settings in SU3. But still I am not getting the Date in correct format. Is there any other place that I have to correct the Date format???
    Regards
    Jay

    Jayanth,
    I feel in your case, going to the System (in menu)-User Profile-Own data then, you get, Maintain user profile. Here you have the option of Maintaining, Date format.
    Hope this helps....

  • Change the locale Date Format

    Hi,
    By default the date formats in web dynpro applications changes with the locale. For the locale US, the date format comes with the seperator '/ ' for German with '.'.
    But we need to have the seperator '.' for all locales. Where can this standard setting be changed?
    Thanks & Regards,
    Syam.

    Hi,
    Refer the following link:
    Java Webdynpro Date Format
    This might be helpful to you.
    Regards,
    Jithin

  • External date format in oracle source system

    Hai friends ,
    My situation is data reconciliation on the cube .I have virtual provider designed with date .My oracle source system has dates in external format say 19-sep-2009 .How to approach my virtual provider in BI with these date fields ..
    iam thinking of inversion routines to communicate with the source system and then reconvert again to BI format in the start routine .Suggest me if any logics with examples.
    Goodday.

    Hello,
    Please refer to the information in the SAP note 518241 , the note refers to DB connect but the section in the note on converting the
    date fields to SAP date format should also be helpful in your case.
    Best Regards,
    Des

  • Date Format in Zreport similar to the default date format set using su01.

    Dear All,
                I have a requirement as to change the date format in Zreport as the one which is set in default date format for the user in Su01 tcode.
    Ex.. If the user has set the default date format in SU01 as ' YYYY-MM-DD' , in report also, date should appear as '2009-12-24'.
    Is there any code  or  Function Module to change the date format in report as in the default Date format?
    Can u help me in this?
    Bye.....
    Cheers
    Christina.

    Try the following code.
    select the format of current user from usr01 table.
        SELECT SINGLE datfm FROM usr01
        INTO w_datfm
        WHERE bname = sy-uname.
    Format based upon the current user settings. put this total code inside one form for reusability.
        IF w_datfm = '1'.
          CONCATENATE w_date6(2) c_dot w_date4(2) c_dot w_date+0(4) INTO outtab-value.
          CONDENSE outtab-value NO-GAPS.
          CONCATENATE w_rundate6(4) w_rundate3(2) w_rundate+0(2) INTO w_date.
          CONDENSE w_date NO-GAPS.
        ELSEIF w_datfm = '2'.
          CONCATENATE w_date4(2) '/' w_date6(2) '/' w_date+0(4) INTO outtab-value.
          CONDENSE outtab-value NO-GAPS.
          CONCATENATE w_rundate6(4) w_rundate0(2) w_rundate+3(2) INTO w_date.
          CONDENSE w_date.
        ELSEIF w_datfm = '3'.
          CONCATENATE w_date4(2) '-' w_date6(2) '-' w_date+0(4) INTO outtab-value.
          CONDENSE outtab-value NO-GAPS.
          CONCATENATE w_rundate6(4) w_rundate0(2) w_rundate+3(2) INTO w_date.
          CONDENSE w_date.
        ELSEIF w_datfm = '4'.
          CONCATENATE w_date0(4) '-' w_date4(2) '-' w_date+6(2) INTO outtab-value.
          CONDENSE outtab-value NO-GAPS.
          CONCATENATE w_rundate0(4) w_rundate5(2) w_rundate+8(2) INTO w_date.
          CONDENSE w_date NO-GAPS.
        ELSEIF w_datfm = '5'.
          CONCATENATE w_date0(4) '/' w_date4(2) '/' w_date+6(2) INTO outtab-value.
          CONDENSE outtab-value NO-GAPS.
          CONCATENATE w_rundate0(4) w_rundate5(2) w_rundate+8(2) INTO w_date.
          CONDENSE w_date NO-GAPS.
        ENDIF.

  • Change the date format from mm/dd to dd/mm

    Is there any way to change the date format? Currently, my today screen, calendar app, etc is set to display dates as mm/dd. I'd like to change it to the UK format (dd/mm) but I have not been able to find a single method that works. I've tried themes as some have recommended but once I install them, it's still showing mm/dd.
    I'm not unfamiliar with upgrading the OS and "slimming" it down, so even a method that requires me to remove US resource files will be okay.
    Frankly I'm disappointed RIM doesn't provide users with a "Regional Settings" type option like in Windows to change the date format.
    Any advice would be most appriciated.

    Yes you can change Date format from mm/dd to dd/mm its done automatically by " Display language " selected :
    Go to Menu : Setup - choose  - Language and Input Methods - look for " Display Language" there is a  small window with down arrow , click the down arrow and ,  change from " English"  to " English (UK)  "for DD / MM ,date format , or change to       " English (US) "  for MM / DD date format.
    Hope this help .

Maybe you are looking for

  • Problem in sending mail through dynamics actions

    Hi Friends, I have a problem in sending mail through dynamics actions . In this  we pass a subroutine in dynamics actions which send an mail when promotion action occured. Problem is that sometimes it will  send an mail or sometimes not. I have no id

  • Missing photos when importing from a Fuji s602zoom digital camera

    I noticed that when I import the photos from my digital camera (as above), sometimes there are some missing. No error messages displayed and the import seems to finish OK. This makes life difficult as I cannot now trust iPhoto and have to check every

  • Inerview questions

    Hi friends      can u give me answers for this questions...............plz 1. What is IBAN Number in SAP? What does it works? 2. How can we block, a particular payment term for a particular vendor. 3. I run my app and I printed my check and after tha

  • The audio goes BEEP BEEP BEEP instead of playing the soundtrack

    Hello again, from me who am still a newbie. I have some footage taken on a different camera from mine, in DV not HD fomat, PAL still, which was imported using iMovie 08 and which plays happily in that sw. In FCE when I play it in the viewer it's all

  • New user elements 11

    I have just started using PE 11 and have found there is only a basic theme in photo collage, are there others available to download? my product is activated etc. it isn't a trial version.