Modify DATE format only for a column

DB table has two or more columns of DATE type of which a column representing "Date of Birth" should not be of the format of TIMESTAMP . When queried it should return "mm/dd/yyyy" format without 'hh:mm:ss' . The others should be as usual.
This is to ensure no changes in the applications querying this columns
Any hints appreciated
Thanks

It depends on NLS_DATE_FORMAT and NLS_TIMESTAMP_FORMAT that is set in the database or session and the datatye used in the table, here is an example:-
U1@BABU>  CREATE TABLE TEST_TAB (DATE1 DATE, DATE2 TIMESTAMP);
Table created.
U1@BABU> INSERT INTO TEST_TAB VALUES (SYSDATE,SYSDATE);
1 row created.
U1@BABU>  COMMIT;
Commit complete.
U1@BABU> SELECT * FROM TEST_TAB;
DATE1 DATE2
22-DEC-06 22-DEC-06 11.44.18.000000 AM
U1@BABU> SELECT * FROM NLS_SESSION_PARAMETERS;
PARAMETER                      VALUE
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE              AMERICAN
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY              $
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE
17 rows selected.
U1@BABU> ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
Session altered.
U1@BABU> SELECT * FROM TEST_TAB;
DATE1 DATE2
22-DEC-2006 11:44:18 22-DEC-06 11.44.18.000000 AM
U1@BABU> SELECT TO_CHAR(DATE1,'MON-DD-YYYY HH24:MI:SS') DATE1, TO_CHAR(DATE2,'Month DD YYYY') DATE2
FROM TEST_TAB;
DATE1                DATE2
DEC-22-2006 11:44:18 December  22 2006

Similar Messages

  • What is data format "Hypertext Link" in column properties??

    Hi,
    What is data format "Hypertext Link" in column properties? How to use it?
    Can I use column value to navigate to other report without using "Value Interaction" in column properties.

    By changing the data format to say HTML, or Hypertext link, you can add HTML content/HTML tags within the column formula.
    You can create a column formula that would resolve into a dynamic hyperlink and pass parameters by using Go Url. Check out Chapter 11 in the Oracle® Business Intelligence Presentation Services Administration Guide
    Check out an example:
    Re: Dyanmic display of the Image Link URL
    Search the forum as well for several similar examples.

  • Current date of birth for my column is null getting error....

    Hi All..
    i am calucating the current date of birth for my column which is date field and accept nulls (cust_dob) in my table.
    select cust_dob,Add_Months(
    to_date(cust_dob, 'dd/mm/yyyy'),
    Months_Between(
    trunc(sysdate, 'year'),
    trunc(to_date(cust_dob, 'dd/mm/yyyy'), 'yyyy')
    ) as current_dob from m_customer_hdr
    when i execute my query in toad. it is showing the result. but when i scroll down to see data it thow error as
    ORA-01858: a non-numeric character was found where a numeric was expected...
    Thanks in advance..
    Abdul rafi

    What datatype is cust_dob datatype. Somehow I have a feeling it is DATE. If so, expression:
    to_date(cust_dob, 'dd/mm/yyyy')Implicitly converts cust_dob to a string using session nls_date_format and then converts it back to date using 'dd/mm/yyyy' format. Now if NULL dob are fetched first, you might get something like:
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-RR';
    Session altered.
    SQL> SET SERVEROUTPUT ON
    SQL> BEGIN
      2      FOR v_rec IN (SELECT  TO_DATE(cust_dob,'mm/dd/yyyy') cust_dob
      3                      FROM  (
      4                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
      5                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
      6                             SELECT TO_DATE(NULL) cust_dob FROM DUAL UNION ALL
      7                             SELECT sysdate cust_dob FROM DUAL
      8                            )
      9                   ) LOOP
    10        DBMS_OUTPUT.PUT_LINE('DOB = "' || v_rec.cust_dob || '"');
    11      END LOOP;
    12  END;
    13  /
    DOB = ""
    DOB = ""
    DOB = ""
    BEGIN
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    ORA-06512: at line 2So if column CUST_DOB is DATE, use:
    select cust_dob,Add_Months(
    cust_dob,
    Months_Between(
    trunc(sysdate, 'year'),
    trunc(cust_dob, 'yyyy')
    ) as current_dob from m_customer_hdrSY.

  • Showing Sub-Totals only for Specific Column in PowerView

    Hi,
    Is there a way of showing the sub-totals only for specific columns in a PowerView Matrix?
    I am only aware of showing the sub-totals for all or non of the columns.
    Thanks and Regards,
    Justin

    Hi Justin,
    According to your description, you want to get sub-totals specific columns within columns group. Right?
    In this scenario, we can use IIF() function in expression to achieve your goal. The expression will only return the total value when the column value is a specific value, otherwise we can make it return nothing. Try the following expression:
    IIF(Fields!Column.Value="[specific value]",Sum(Fields!Total.Value),nothing)
    We have tested this scenario in our local environment. Here are screenshots for your reference:
    Reference:
    Expression Examples (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to modify date format for Standard Purchase Order  Template XSL-FO

    I am editing the XSL-FO for the Standard Purchase Order.
    I need to modify the promised date column to 'DD-MON-YYYY’' , tried to use substring in below line but it didn't work
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    Any solution for this ?
    thanks
    Pravin

    Thanks for your response.
    I tried to change the code in below format but it was giving error.
    Original code
    <xsl:value-of select="LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE"/>
    modified to
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried with
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd-mmm-yyyy hh24:mi:ss',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    also tried like
    <xsl:value-of select="xdoxslt:format_date(LINE_LOCATIONS/LINE_LOCATIONS_ROW/PROMISED_DATE,'dd-mmm-yyyy','dd/mmm/yyyy',$_XDOLOCALE,$_XDOTIMEZONE)"/>
    Tried above 3 methods but it didn't work.
    right now the date format in pdf file is 24-MAY-2011 21:56:24 i need to remove 21:56:24 and have only 24-MAY-2011
    any suggestions.
    thanks

  • How to modify date format for Standard Purchase Order

    In the Standard Purchase Order I have been trying to modify the date format of the Need by and Promised Date. To display DD-MON-YYYY please could some advise.
    Thanks

    The varaibles and prarameters I am using are.
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ora="http://www.oracle.com/XSL/Transform/java/" xmlns:xdofo="http://xmlns.oracle.com/oxp/fo/extensions" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions" xmlns:xdoxliff="urn:oasis:names:tc:xliff:document:1.1">
    <xsl:param name="_XDOCALENDAR">GREGORIAN</xsl:param>
    <xsl:param name="_XDOLOCALE">en-US</xsl:param>
    <xsl:param name="_XDOTIMEZONE">GMT</xsl:param>
    <xsl:param name="_XDODFOVERRIDE">;</xsl:param>
    <xsl:param name="_XDOCTX">#</xsl:param>
    <xsl:variable name="_XDOXSLTCTX" select="xdoxslt:set_xslt_locale($_XDOCTX, $_XDOLOCALE, $_XDOTIMEZONE, $_XDOCALENDAR, $_XDODFOVERRIDE)" />

  • Custom Data Formatting Gone for Dates

    Another new aspect of the updated Numbers app for OS X is the loss of customizing data formats.  There are more options via a drop down, but there's less customization.  For example.  I had a use case where I'd take a column full of dates and would replicate it so the same data was in two columns.  I then was able to customize the first column of dates to use a month shortcode only so it would render "Jan, Feb, Mar, Apr..." depending on the data in that column.  The next colum with the same data I'd then customize to show only the day of the month.  See the example below.
    Date
    Column 1
    Date
    Column 2
    Jan
    4
    Mar
    15
    Oct
    23
    Presently, neither the shortnames for months by themselves nor the day of the month by itself is available as an option when working in the Data Format panel.
    I'm assuming the customization was killed, but if someone knows if that's hidden elsewhere, please let me know!

    Hi Bret,
    I don't know the answer to your actual question as I tend to later adoption, and am not yet using Numbers 3.0, but here's a workaround (with some limitations, noted below).
    Limitations:
    Requires that the values in the cells are created by formulas, or can be created by formulas referencing another cell.
    The resulting values will be a text string (column A) or a numeric value (column B), not a Date and Time value.
    A: =LEFT(MONTHNAME(MONTH(formula)),3)
    B: =DAY(formula)
    In each, formula is the existing formula used to determine the D&T value currently in the cell.
    Regards,
    Barry

  • Implicit date format conversion of report column

    Hello,
    The following expression defines date format for report column implicitly and doesn't reflect FSP_LANGUAGE_PREFERENCE with language independent format mask of the column attribute anymore:
    decode(end_date, to_date('31.12.2047', 'dd.mm.yyyy'), null, end_date) closed
    end_date is of TIMESTAMP(0) WITH LOCAL TIME ZONE type, format mask of the column attribute: DS TS
    Is it expected behavior?
    Thanks

    Edward Shevtsov wrote:
    Hello,
    The following expression defines date format for report column implicitly and doesn't reflect FSP_LANGUAGE_PREFERENCE with language independent format mask of the column attribute anymore:
    decode(end_date, to_date('31.12.2047', 'dd.mm.yyyy'), null, end_date) closed
    end_date is of TIMESTAMP(0) WITH LOCAL TIME ZONE type, format mask of the column attribute: DS TS
    Is it expected behavior?
    ThanksThe reason might be that you compare different datatypes in the SQL statement. The output of decode depends on those parameters.
    You can cast the column to a specific datatype or you make sure that your wanted datatype is used during the decode.
    example
    decode(end_date, to_timestamp_tz('31.12.2047', 'dd.mm.yyyy'), null, end_date) closed
    or
    cast(decode(end_date, to_date('31.12.2047', 'dd.mm.yyyy'), null, end_date) as timestamp(0) with local time zone) closed

  • GOOP VI "set modified data" locks LabVIEW for seconds

    I use GOOP.
    Sometimes the VI "set modified data" (from now on SMD) of one of my GOOP classes is locked for about 15 seconds, while CPU raises to 100%.
    It happens when SMD is called from a certain VI. It does not happen every time SMD is called from this VI.
    As I have understood GOOP, the VI "get data to modify" tries to access/lock the data members - which might take a while if the the data members are currently locked by another VI - but SMD only sets the data members and removes the lock, which should always be possible (at least if the data set has been locked by this VI, which - yes! - is the case).
    Other VIs are running in parallell, maybe they could cause the CPU to raise to 100% but I find it strange th
    at it only happens when SMD is called from this particular VI.
    I think I need a better understanding for how SMD really works.
    Regards

    Hi,
    Your description of how "get data to modify" (from now on called GDM) and "set modified data" works is correct and you have fully understand how it all works. The only VI that actually may wait is the "get data to modify" (happens if the data for the object is locked by something running in parallell as you describe). The GDM is however reentrant so that it really will be able to wait for seconds (specified by the timeout) and also letting other process wait as well using the GDM. The SDM is not reentrant (does not have to) and should really execute fast (set data and unlock) and never hold execution, just as you describe.
    Are you absolutly sure that it is the SMD that cause the CPU to freak out? Maybe the fact that you unlock the data releases ano
    ther part of your program that were "hanging on the lock" and the problem is actually in another part of the program. Do you have some exceptional large size of your data? Do you somehow elaborate with VI priorities and/or reentrant VIs. This might sometimes really cause strange situations. The situation you describe looks more like a "race" problem.
    The SDM problem you describe is new to me and I have never encounted it. Would it be possible for you to attach some LV code example showing the phenomenon?
    Best regards,
    Mattias Ericsson
    Endevo Sweden
    (member of the GOOP developer team)

  • DATE FORMAT Conversion FOR SQL Reports

    Hi,
    Am building a report and am stuck here where this piece of code that throws the following error
    The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
    My query goes some thing like this
    DECLARE @StartDate varchar(15),
    @EndDate Varchar(15)
    SELECT @StartDate = '01/08/2014',
    @EndDate = '31/08/2014'
    SELECT DISTINCT
    [Operation] = CASE WHEN p.DATE_OF_START BETWEEN @StartDate AND @EndDate THEN 'Add'
    ELSE 'Update' END
    FROM SNZ_HR_Reporting_POSMGNT as s
    LEFT OUTER JOIN PERSON as p on s.EMP_NO = p.EMP_NO
    WHERE s.CHANGE_DATE BETWEEN @StartDate AND @EndDate
    The date format in the column DATE_OF_START  is like yyyy-mm-dd 00.00.00.000 .
    My question is how to convert this format to dd/mm/yyyy format and execute the queries
    Many Thanks,
    Bhanu

    SQL Date Format:
    http://www.sql-server-helper.com/tips/date-formats.aspx
    Please Mark This As Answer if it helps to solve the issue

  • Aired Date - US date format only?

    Is there a way of showing +Aired Date+ in a date format other than the US one?
    US date formats are very confusing and catch you out if you are used to the eminently more sensible DD/MM/YYYY format.
    This is particularly annoying when tagging content for the Apple TV with Meta X or Subler, as you have to remember to put the first to two parts of the date in backwards.
    I've never understood the US date format as it doesn't flow properly - ie. smallest/bigger/biggest -(the US one is oddly bigger/smallest/biggest)!

    {quote:title=Chenks wrote:}
    out of interest, how many countries other than UK use the "UK format" for dates? it's probably the UK that is being different to everyone else (just like driving on the left)?{quote}
    FYI here is a list of countries using DD/MM/YY formatting for dates:
    Albania
    Algeria
    Argentina
    Armenia
    Australia
    Austria (using dots (which denote ordinal numbering)
    Azerbaijan
    Bahrain
    Bangladesh
    Barbados
    Belarus
    Belgium
    Bolivia
    Brazil
    Bulgaria
    Canada
    Chile
    Colombia
    Costa Rica
    Croatia
    Cyprus
    Czech Republic
    Denmark
    Dominica
    Dominican Republic
    Ecuador
    Egypt
    El Salvador
    Estonia
    Finland
    France
    Georgia
    Germany (using dots (which denote ordinal numbering)
    Greece
    Greenland
    Grenada
    Guatemala
    Guyana
    Hong Kong (in English)
    Honduras
    Iceland
    India (dd.mm.yyyy in Bengali; dd-mm-yyyy in Gujarati, Hindi, Marathi, Punjabi, Tamil; d-m-yyyy in Telugu, no leading zeroes used)
    Indonesia
    Iraq (dd/mm/yyyy)
    Ireland (dd-mm-yyyy)
    Israel (dd/mm/yyyy)
    Italy
    Jamaica
    Jordan
    Kazakhstan (dd.mm.(yy)yy)
    Kenya (dd/mm/yyyy)
    Kuwait
    Kyrgyzstan (dd.mm.yyyy)
    Latvia
    Lebanon
    Libya
    Luxembourg(dd/mm/yyyy in French, d.m.yyyy in German)
    Macau (in Portuguese & English)
    Macedonia (dd.mm.yyyy)
    Malaysia
    Mexico
    Montenegro (d.m.yyyy)
    Morocco
    Netherlands (using hyphens as in “dd-mm-(yy) yy”, very often "d month (yy)yy")
    New Zealand
    Nicaragua
    Norway (d.m.y; the fraction form d/m-y is common, but incorrect)
    Oman
    Pakistan (dd/mm/(yy)yy)
    Panama
    Paraguay
    Peru
    Philippines (in Filipino)
    Poland (dd.mm.yyyy, often with dots as separators; more official is d <month in genitive> yyyy, or, less frequently, d <month in Roman numerals> yyyy)
    Portugal
    Qatar
    Romania (dd.mm.yyyy)
    Russia (dd.mm.(yy)yy)
    Saint Kitts and Nevis
    Saint Lucia
    Saint Vincent and the Grenadines
    Saudi Arabia (dd/mm/yyyy in Islamic and Gregorian calendar systems, except for major companies, which conventionally use the American mm/dd/yyyy format)
    Serbia (d.m.yyyy)
    Singapore (English)
    Slovakia (d.m.yyyy, some use of dd-mm-yyyy)
    Slovenia (d.m.yyyy or d. mmmm yyyy)
    Spain
    Sri Lanka
    Sweden (as d/m yyyy, although the yyyy-mm-dd form is more common and the national standard.)
    Switzerland (dd.mm.yyyy)
    Syria
    Tajikistan (dd.mm.yyyy)
    Thailand (with Buddhist Era years instead of Common Era)
    Trinidad and Tobago
    Tunisia
    Turkey
    Turkmenistan (dd.mm.(yy)yy)
    Ukraine (dd.mm.yyyy; some cases of dd/mm/yyyy
    United Arab Emirates
    United Kingdom - YAY!
    Uruguay
    Uzbekistan (dd.mm.yyyy Cyrillic, dd/mm yyyy Latin)
    Venezuela
    Vietnam
    Yemen
    Here is a list of countries that use MM/DD/YY:
    Belize
    Canada (Although most official government documents use the yyyy-mm-dd format, the mm/dd/yy format is also understood due to influences from the United States.)
    Federated States of Micronesia
    Palau
    Philippines (when written in English)
    United States (civilian vernacular: mm/dd/yy or mm/dd/yyyy; other formats, including dd Month yyyy and yyyy-mm-dd, are common or prescribed—particularly in military, academic, scientific, computing, industrial, or governmental contexts.)
    I always find it interesting just how the US proscribe something as being a 'Standard' when what they really mean is that it is way the US does it. In the same way as English is referred to as 'International English' and American English is just called English by American corporations
    /rant
    Message was edited by: Easybourne

  • Infopath form data coming only for published user

    Hello,
    I have published one web browser based infopath form all the data is coming only for me ,but when other user opened that form with his/her loginid all fields are blank.Why is it so? Any help
    Thanks,

    Hi,
    According to your description, my understanding is that the form data cannot be displayed when other users accessed the form.
    As Hemendra suggested, please check if there are any rules in the form to display the data to specified users.
    To match a user with the current login user, then we can set the filter with AccountId inside the Login Account group to equal userName() to get the corresponding employee id.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Date format (YYMMDD ) for the file

    HI All,
    I need to place a file with file name that should include the date in the format YYMMDD. Currently the format is DDMMYY.
    How can i do that?
    Thanks In advance!!

    Perhaps by changing the date format in the personal settings of the user that creates the file.
    Check transaction su01 - username - defaults
    Kind regards,
    Mark

  • Download Formatting Mask for BLOB column

    Hi All,
    IR Query : select "ROWID","FILE_NAME",dbms_lob.getlength("DATA_FILE") "DATA_FILE",
    "DOC_SIZE",PROPOSAL_OWNER
    from "#OWNER#"."APXTER_IMP_HDR"
    I am using BLOB Download Format Mask on FILE_NAME column
    using the following FORMATTING
    DOWNLOAD:APXTER_IMP_HDR:DATA_FILE:ROWID::::::attachment:Download
    After applying the changes, I counter the error
    The number of display columns in the report reached the limit. Please click Select Columns under Actions menu to minimize the report display column list.
    Thanks,
    Sombit

    Hello,
    Here you can find a tutorial about blob:
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    I have a demo here - it shows how to display an image in case the file is image. Otherwise, it displays download link:
    http://apex.oracle.com/pls/apex/f?p=63066:1
    workspace: somefeto
    user: test
    pwd: test
    Application 63066
    Also, there is a packaged application : Sample File Upload and Download that shows you, how to do it.....
    you can find it on your workspace.. or here if you wish:
    http://apex.oracle.com/pls/apex/f?p=10540:3:15582111009947::NO
    workspace: somefeto
    user: test
    pwd: test
    Regards,
    Fateh
    If you believe that my answer was helpful to you or correct, then please mark the answer as helpful or correct ...

  • Date format function for 5/2/2010 9:46:00 AM?

    Hi,
    I want to convert date format in dd/mm/yyyy hh:mm:ss AM/PM format.
    Any suggestion?
    Thanks.

    You can use:
    <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME';’GMT-5’?>
    Your date must be in ISO format, please read below
    Reference:
    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535403
    regards
    Jorge

Maybe you are looking for

  • Changing apple username and password on your iPad

    Some water got into my iPad 1. I put it away in a drawer and bought the iPad 2. About eight months later I came across the first iPad, so I plugged it in. Sure enough it started working again. It had all my info on it and I want to give it to my gran

  • TSPITR using backups from standby

    Hi, I would like to ask for your opinion/advice regarding the following scenario. We have a primary 10.2.0.3 RAC database which has a physical standby database, both sites being managed through dataguard. Every night full RMAN backups are taken for t

  • Generate IDoc from MM02 automatically !

    Hi All, I have gone through many posts, but could find a way where i could generate an IDoc and Dispatch it the moment a Material is saved after changes being done. There is ofcourse a way i.e. to schedule RBDMIDOC in the background at regular interv

  • Java.util.Formatter vs. java.text.MessageFormat

    Hi, Which formatter is faster java.text.MessageFormat or java.util.Formatter? At the moment I format all my strings with java.text.MessageFormat, however I want to speed-up the formatting of the strings that I log, so I though of using java.util.Form

  • Failed test VerifyEnterpriseReferences

    Hello, DCDiag is failing at "VerifyEnterpriseReferences". Any assistance on this would be greatly appreciated, thanks! Please see full details of error below:       Starting test: VerifyEnterpriseReferences          The following problems were found