Subject Re: [ib-support] Convert String To Date
Author Helen Borrie
At 11:04 AM 28/01/2003 +0530, you wrote:
>Hi,
>
> I have one field as String which is storing the date value as
>string.(Eg: 16/01/2003 as string ).
>Now how can i convert this string into Date in query.
>
>I tried this query.But it is giving conversion error from string.
>
>select cast(field_name as date) from table_name;
>
>Please help me..

You need to study the manual. See the Data Definition Guide, the section
on date and time types, to see what the valid literal strings are for
dates. Your date example is not a valid date literal string, since the "/"
is the date separator for mm/dd/[cc]yy format and there are not 16 months
in a year.

Simply, you have made it hard for yourself by choosing to store dates this
way. You will need to write a procedure or a UDF to convert your string
into a valid date literal.

heLen