<No Subject Supplied>
Posted in 1993
>From naomi Fri Jul 30 5:34:18 MST 1993 remote from qip
From: naomi@qip (Naomi Walker)
Message-Id: <9307301234.AA04687@qip>
Received: from qip by misty.anasazi.com; Fri, 30 Jul 93 05:34:20 MST
Received: by qip (5.61/1.4)
(from naomi (Naomi Walker) to informix-list@rmy.emory.edu)
id AA04687; Fri, 30 Jul 93 05:34:18 -0700
Subject: Re: Informix SQL query on INTEGER column
To: informix-list@rmy.emory.edu (Informix List)
Date: Fri, 30 Jul 93 5:34:18 MST
In-Reply-To: <1993Jul29.203531.7451@porthos.cc.bellcore.com>; from "Greg George" at Jul 29, 93 8:35 pm
X-Mailer: ELM [version 2.3 PL11]
Content-Type: text
Content-Length: 725
>
> I'm trying to do an informix SQL SELECT on an INTEGER column to get
> only the first 3 digits of the number. For example, if i have
> the following table:
>
> CREATE TABLE t1
> ( field1 INTEGER,
> field2 CHAR(10) );>
> Now, if I have 12345 in field1, how can I do a select on the table
> and only display the first 3 digits (ie: 123).
>
I can think of a few ways.....
divide by 100 and print the truncated integer
or
turn the number into a string (itoa) , and print the first 3 characters
--
Naomi Walker (aka N7FSA) naomi@anasazi.com
Phoenix, Arizona
To get the full value of joy,
you must have someone to divide it with. ---Mark Twain