Thread: type casting: varchar to date

type casting: varchar to date

From
"J.Fernando Moyano"
Date:
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

From
Karel Zak
Date:
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