Обсуждение: type casting: varchar to date

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

type casting: varchar to date

От
"J.Fernando Moyano"
Дата:
Is there some way to do something like this ?? :

crate table t (
a    varchar(12),
b    date
);

select (a::date-b) from t;

ERROR: cannot cast type 'varchar' to 'date'.


Thanks ....

-- 
Fer


Re: type casting: varchar to date

От
Karel Zak
Дата:
On Tue, 6 Feb 2001, J.Fernando Moyano wrote:

> 
> Is there some way to do something like this ?? :
Yes,
select to_timestamp('hello 02-06-2001', '"hello "MM-DD-YYYY'); 
    Karel