convert from an integer to a date

Поиск
Список
Период
Сортировка
Искать

convert from an integer to a date

От:
STashlitsky@JEFCO.com
Дата:

When I run select to_date('20030212','YYYYMMDD') the output is 2/12/03
if I run select to_date( to_char(20030212,99999999),'YYYYMMDD'); the output is 6/23/05

How can I convert from integer into date format correctly?

Thanks for any help with this.

Svetlana




Jefferies archives and reviews outgoing and incoming e-mail. It may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited.

Re: convert from an integer to a date

От:
Frank Bax <fbax@sympatico.ca>
Дата:
At 04:33 PM 2/14/03, STashlitsky@JEFCO.com wrote:
>When I run select to_date('20030212','YYYYMMDD') the output is 2/12/03
>if I run select to_date( to_char(20030212,99999999),'YYYYMMDD'); the 
>output is 6/23/05
>
>How can I convert from integer into date format correctly?


Same as the first one, except leave out the quotes.        select to_date(20030212,'YYYYMMDD');


Re: convert from an integer to a date

От:
miquels@cistron-office.nl (Miquel van Smoorenburg)
Дата:
In article , wrote:
>How can I convert from integer into date format correctly?

traffic=# select date(20030212);   date    
------------2003-02-12
(1 row)

or

traffic=# select 20030212::text::date;   date    
------------2003-02-12
(1 row)

Mike.
-- 
Anyone who is capable of getting themselves made President should
on no account be allowed to do the job -- Douglas Adams.


FAQ