Type Conversion: int4 -> Money

From: secret <secret(at)kearneydev(dot)com>
To: PG-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Type Conversion: int4 -> Money
Date: 1999-07-06 18:49:20
Message-ID: 37824FB0.4BD0714C@kearneydev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there a way to convert an int4 into a money? I have a few reports
that require format of int4 as a money(I didn't use money for money
because it's very difficult to convert money into other types it
seems)...

The only way I can figure out how to do it is a kludge, such as:

CREATE TABLE z(a int4, b money);

Fill a with appropriate values, then set b as "1". SELECT a*b as a FROM
z... And your done... But there should be some easier way to convert an
int4 into a money rather than mulitply it?

--David

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message blackgr 1999-07-06 21:08:30 Re: [SQL] problem creating table
Previous Message Eid, Bilal 1999-07-06 18:42:47 Large Objects