Subject Re: [ib-support] Cast String to Date
Author Kubanychbek Tajmamat uloo
Sivaraman:

You can run
-------------------
select cast('01/16/2003' as date) as mydate from rdb$database
-------------------
with any tool (isql, ibconsole, ibexpert, etc)
with any valid database and get
16.01.03 or 16.01.2003
which means the string was converted to date.

Kubanych

>At 04:24 PM 31/01/2003 +1100, you wrote:
>
>
>>Sivaraman,
>>Several people (including myself) have already responded to this question
>>when you posted it some days ago. The short answer is that you can't cast
>>this string directly to a date type via SQL, because it is not a valid date
>>literal (the engine does not support mm/dd/ccyy as a date format).
>>
>>Please check back through recent archives for the responses.
>>
>>heLen
>>
>>
>>At 10:44 AM 31/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..
>>>
>>>Sivaraman
>>>
>>>
>>>To unsubscribe from this group, send an email to:
>>>ib-support-unsubscribe@egroups.com
>>>
>>>
>>>
>>>Your use of Yahoo! Groups is subject to
>>>
>>>
>><http://docs.yahoo.com/info/terms/>http://docs.yahoo.com/info/terms/
>>
>>
>>
>>To unsubscribe from this group, send an email to:
>>ib-support-unsubscribe@egroups.com
>>
>>
>>
>>Your use of Yahoo! Groups is subject to the
>><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>>
>>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>