Re: cast varchar to numeric/money

From: "Yudie" <yudie(at)axiontech(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cast varchar to numeric/money
Date: 2003-11-21 18:26:57
Message-ID: 005201c3b05d$0cbb1460$8401a8c0@home.axiontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I don't have to_numeric function in my 7.2.2 postgre.
then it can resolve it with:

cast(substr(varcharcolumn,0) as float4)

thanks.

----- Original Message -----
From: "Bruno Wolff III" <bruno(at)wolff(dot)to>
To: "Yudie" <yudie(at)axiontech(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, November 21, 2003 11:55 AM
Subject: Re: [SQL] cast varchar to numeric/money

On Fri, Nov 21, 2003 at 11:47:42 -0600,
Yudie <yudie(at)axiontech(dot)com> wrote:
> Hi guys,
>
> I know it's impossible to just cast varchar to any numeric datatype,
> but is there another function/ custom function or any way to force to do
> that convertion.

You can use to_number to go from text to numeric.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2003-11-21 19:03:16 Re: Expressional Indexes
Previous Message Gaetano Mendola 2003-11-21 18:01:32 Re: How to quote date value?