pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: secret <secret@kearneydev.com>
To: PG-SQL <pgsql-sql@postgresql.org>
Subject: Type Conversion: int4 -> Money
Date: Tue, 06 Jul 1999 14:49:20 -0400
Message-ID: <37824FB0.4BD0714C@kearneydev.com> (raw)

    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





view thread (7+ messages)  latest in thread

Message-ID: <37824FB0.4BD0714C@kearneydev.com>
Permalink:  ../37824FB0.4BD0714C@kearneydev.com/
Also on:    postgresql.org/message-id/37824FB0.4BD0714C@kearneydev.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: secret@kearneydev.com
  Subject: Re: Type Conversion: int4 -> Money
  In-Reply-To: <37824FB0.4BD0714C@kearneydev.com>
  References: <37824FB0.4BD0714C@kearneydev.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox