Type Conversion: int4 -> Money - Mailing list pgsql-sql

From secret
Subject Type Conversion: int4 -> Money
Date
Msg-id 37824FB0.4BD0714C@kearneydev.com
Whole thread Raw
Responses Re: [SQL] Type Conversion: int4 -> Money  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List 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




pgsql-sql by date:

Previous
From: "Eid, Bilal"
Date:
Subject: Large Objects
Next
From: blackgr
Date:
Subject: Re: [SQL] problem creating table