close
標題:

Sqlplus cannot display date format

發問:

My SQLplus is chinese version. It cannot display date format such as '12-Oct-2007;, only can display 12/10/2007. Can anyone help me ? Many Thanks! 更新: Thanks for your reply ! But how can solve this problem permanently instead of using the select statement. Do you know that any SET command to adjust the date format 更新 2: sorry, I cannot see the command "FormatDateTime('dd"-"mon"-"yyyy', Now)". Does it is SET command?

最佳解答:

Try: SELECT CONVERT(VARCHAR(11), GETDATE(), 106) AS [DD-MON-YYYY] or FormatDateTime('dd"-"mon"-"yyyy', Now) It would help if you would post the command you are using so we can help you modify it to display the desired format. 2007-10-13 23:43:48 補充: Try the following command, or any variation you wish to use:alter session set nls_date_format = 'DD-MON-YYYY hh24:mi:ss';This will change all subsequent output using the DATE datatype. 2007-10-21 09:03:32 補充: In case the supplemented answer was not clear, here it is again:ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY hh24:mi:ss';This will change the DATE datatype output of subsequent output of the session. 2007-10-23 22:17:01 補充: In that case, you can try the following in your select statementsTO_CHAR(b, 'DD-MMM-YYYY';), for example:SELECT TO_CHAR(DOB,'DD-MMM-YYYY') birthdate FROM PERSONALWHERE ....;

其他解答:

免費註冊體驗

 

此文章來自奇摩知識+如有不便請留言告知

arrow
arrow
    文章標籤
    文章 奇摩
    全站熱搜
    創作者介紹
    創作者 vbd391t 的頭像
    vbd391t

    vbd391t的部落格

    vbd391t 發表在 痞客邦 留言(0) 人氣()