Subject | Re: [ib-support] SQL Help |
---|---|
Author | Sindu |
Post date | 2001-03-19T02:42:09Z |
Hi,
try using UDF 'ceiling' instead of trunc(foo + 0.9999)
you have to declare it first though:
declare external function ceiling double precision
returns double precision by value
entry_point 'IB_UDF_ceiling' module_name 'ib_udf';
and then try:
select ceiling(5.1) from rdb$database;
hope this helps,
sindu
try using UDF 'ceiling' instead of trunc(foo + 0.9999)
you have to declare it first though:
declare external function ceiling double precision
returns double precision by value
entry_point 'IB_UDF_ceiling' module_name 'ib_udf';
and then try:
select ceiling(5.1) from rdb$database;
hope this helps,
sindu
On Mon, 19 Mar 2001, Charlie wrote:
> I'm using Delphi 5, Interbase 6. I have an Items table that has
> widthstring and heightstring as fields. The client's business rules
> require that the widthstring and heightstring be rounded to the next
> integer; so 12.5 would become 13. In other parts of my program I use:
> trunc(widthstring + 0.9999)
> I need to obtain the square feet for each item type of the items for an
> order. So square feet would be:
> trunc(widthstring + 0.9999) * trunc(heightstring + 0.9999) / 144
>
> How do I use a select sum statement in an SQL to sum the square feet.
> I've tried:
> select sum(trunc(widthstring + 0.9999) * trunc(heightstring + 0.9999) /
> 144)) but this doesn't work.
>
> Thank you,
>
> Charlie