Ask a Question related to Informix, Design and Development.
-
Francisco Roldan #1
Query for decimal part
Hi Everybody,
I got a table with a column named amount
of type decimal(26,8) .
I need to make a query to select the rows
with no-integers values on this column (amount).
I mean the rows with decimal part on its value.
Something like this :
select * from shclog
where get_decimals(amount) <> 0
Assuming that the function get_decimals return the
decimal part of the column amount.
Does exist a function like this ?
Thanks in advance
sending to informix-list
Francisco Roldan Guest
-
#39906 [NEW]: Unable to use place holders as part of the actual SQL query with PDO's
From: iab398 at bham dot ac dot uk Operating system: Unix PHP version: 5.2.0 PHP Bug Type: SQLite related Bug description: ... -
Query problem part 2
You are getting the correct data. In your output, you should either do nested <cfoutputs> or a <cfloop> nested in an output. In either case, your... -
Using a & in a query that is actually part of a name
How do I use a & in a query without the script treating it a a concatenation character? For example, I have a company name in a field called "M &... -
decimal validation
how can i use javascript to ensure a the user enters a decimal number up to a certain place holder? what would that code look like? Chris O'Brien -
Need to get the decimal part of a number
Hi. How can I -from an ASP page- get the decimal part of a number ? Thanks in advance for all your help. -
John Carlson #2
Re: Query for decimal part
On Thu, 21 Aug 2003 10:32:29 -0600, Francisco Roldan
<froldan@5b.com.gt> wrote:
Well, not exactly, but this may do . . . . the trunc() frunction.>
>Hi Everybody,
>I got a table with a column named amount
>of type decimal(26,8) .
>I need to make a query to select the rows
>with no-integers values on this column (amount).
>I mean the rows with decimal part on its value.
>
>Something like this :
>
>select * from shclog
>where get_decimals(amount) <> 0
>
>Assuming that the function get_decimals return the
>decimal part of the column amount.
>
>Does exist a function like this ?
>
e.g.
select * from shclog
where (amount-trunc(amount)) = 0
amount is 57.95
trunc(amount) would be 57
difference would be 0.25
amount is 34.00
trunc(amount would be 34
difference would be 0
John Carlson Guest
-
preetinder dhaliwal #3
Re: Query for decimal part
Hi,
Try something like this -
select * from rep_data where
(round(adr_cr_limit,0) * 100 - adr_cr_limit * 100) != 0
( 100 because my col is decimal 2 )
Rgds
Preetinder
Francisco Roldan wrote:
sending to informix-list>Hi Everybody,
>I got a table with a column named amount
>of type decimal(26,8) .
>I need to make a query to select the rows
>with no-integers values on this column (amount).
>I mean the rows with decimal part on its value.
>
>Something like this :
>
>select * from shclog
>where get_decimals(amount) <> 0
>
>Assuming that the function get_decimals return the
>decimal part of the column amount.
>
>Does exist a function like this ?
>
>Thanks in advance
>sending to informix-list
>
>
preetinder dhaliwal Guest
-
Paul Watson #4
Re: Query for decimal part
I haven't tried it but
select *
from table
where decimal_col != decimal_col::INT
should work
Francisco Roldan wrote:-->
> Hi Everybody,
> I got a table with a column named amount
> of type decimal(26,8) .
> I need to make a query to select the rows
> with no-integers values on this column (amount).
> I mean the rows with decimal part on its value.
>
> Something like this :
>
> select * from shclog
> where get_decimals(amount) <> 0
>
> Assuming that the function get_decimals return the
> decimal part of the column amount.
>
> Does exist a function like this ?
>
> Thanks in advance
> sending to informix-list
Paul Watson #
Oninit Ltd # Growing old is mandatory
Tel: +44 1436 672201 # Growing up is optional
Fax: +44 1436 678693 #
Mob: +44 7818 003457 #
[url]www.oninit.com[/url] #
Paul Watson Guest
-
Francisco Roldan #5
RE: Query for decimal part
Thanks John and Preetinder,
It worked both ways :
Select * from table
where (amount-trunc(amount)) <> 0
Select * from table
Where (round(amount,0)*100 - amount * 100)!=0
*
Both generated the same results.
Thank you very much !!
-----Mensaje original-----
De: preetinder dhaliwal [mailto:preetinder.dhaliwal@dhl.com]
Enviado el: Jueves, 21 de Agosto de 2003 11:29 a.m.
Para: Francisco Roldan
CC: [email]informix-list@iiug.org[/email]
Asunto: Re: Query for decimal part
Hi,
Try something like this -
select * from rep_data where
(round(adr_cr_limit,0) * 100 - adr_cr_limit * 100) != 0
( 100 because my col is decimal 2 )
Rgds
Preetinder
Francisco Roldan wrote:
sending to informix-list>Hi Everybody,
>I got a table with a column named amount
>of type decimal(26,8) .
>I need to make a query to select the rows
>with no-integers values on this column (amount).
>I mean the rows with decimal part on its value.
>
>Something like this :
>
>select * from shclog
>where get_decimals(amount) <> 0
>
>Assuming that the function get_decimals return the
>decimal part of the column amount.
>
>Does exist a function like this ?
>
>Thanks in advance
>sending to informix-list
>
>
Francisco Roldan Guest
-
Fernando Ortiz #6
Re: Query for decimal part
Hi Paco:
Try with
select * from shclog
where (amount - amount::int) > 0
HTH
----- Original Message -----
From: "Francisco Roldan" <froldan@5b.com.gt>
To: <informix-list@iiug.org>
Sent: Thursday, August 21, 2003 11:32 AM
Subject: Query for decimal part
sending to informix-list> Hi Everybody,
> I got a table with a column named amount
> of type decimal(26,8) .
> I need to make a query to select the rows
> with no-integers values on this column (amount).
> I mean the rows with decimal part on its value.
>
> Something like this :
>
> select * from shclog
> where get_decimals(amount) <> 0
>
> Assuming that the function get_decimals return the
> decimal part of the column amount.
>
> Does exist a function like this ?
>
> Thanks in advance
> sending to informix-list
Fernando Ortiz Guest



Reply With Quote

