對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 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.
Prathamesh 2010/7/13 上午 8:49 (回應 Srikkanth.M)
Lakmal Rajapakse 2010/7/13 上午 8:51 (回應 Srikkanth.M)
By number do you mean change it to Julian date?
Hoek 2010/7/13 上午 8:52 (回應 Srikkanth.M)
Use TO_CHAR first and apply your desired format mask:
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.
原文出處:how to convert date to number | Oracle Community
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
			