茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1672096 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
Wedding_00014.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2018/8/18 12:51:27
how to convert date to number
Srikkanth.M 2010/7/13 上午 8:47
Hai

How to convert the given date into number.

Thanks & regards



正確答案 建立者: Saubhik 在 2010/7/13 上午 11:05
Look at these posts
Please help me in Converting Lilian Format to Date
converstion to date
and try something like this.
SELECT sysdate,sysdate-to_date('15-10-1582','DD-MM-YYYY') lilian_dt FROM dual;




Prathamesh 2010/7/13 上午 8:49 (回應 Srikkanth.M)
    select to_number(to_char(sysdate, 'j')) from dual




Lakmal Rajapakse 2010/7/13 上午 8:51 (回應 Srikkanth.M)
By number do you mean change it to Julian date?
    select to_number(to_char(sysdate, 'J')) from dual;




Hoek 2010/7/13 上午 8:52 (回應 Srikkanth.M)
Use TO_CHAR first and apply your desired format mask:
    SQL> select to_number(to_char(sysdate, 'yyyymmddhh24miss')) from dual;

    TO_NUMBER(TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS'))
    ----------------------------------------------
                                    20100713105102

    1 row selected.

    SQL>  select to_number(to_char(sysdate, 'yyyymmdd')) from dual;

    TO_NUMBER(TO_CHAR(SYSDATE,'YYYYMMDD'))
    --------------------------------------
                                  20100713

    1 row selected.




Saubhik 2010/7/13 上午 11:05 (回應 Srikkanth.M)
Look at these posts
Please help me in Converting Lilian Format to Date
converstion to date
and try something like this.
    SELECT sysdate,sysdate-to_date('15-10-1582','DD-MM-YYYY') lilian_dt FROM dual;


原文出處:how to convert date to number | Oracle Community
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|