Converting VARCHAR to DECIMAL or NUMERIC

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

Converting VARCHAR to DECIMAL or NUMERIC

От:
Juan Francisco Diaz <j-diaz@publicar.com>
Дата:
The subject says it all... How can that be done? I tried to do an explicit
cast but... Id dint work.

JuanF
(A newbie in evolution!)

Re: Converting VARCHAR to DECIMAL or NUMERIC

От:
Stephan Szabo <sszabo@megazone.bigpanda.com>
Дата:
On Mon, 25 Aug 2003, Juan Francisco Diaz wrote:

> The subject says it all... How can that be done? I tried to do an explicit
> cast but... Id dint work.

I think currently you'll need to convert to text first, so something like:
cast(cast(varcharcol as text) as numeric) because there's no
varchar->numeric direct cast (although I'm not sure if an explicit cast
would be bad for those cases that text has currently that varchar doesn't)


FAQ