Subject | Re: [ib-support] SQL Help |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-03-19T08:06:19Z |
Charlie,
you don't say why your statement doesn't work and I guess the extra
parenthesis is just a typing mistake so it's not easy for us to suggest a
solution. But what happens if you try
select sum(cast(widthstring + 0.5 as Integer) * cast(heightstring + 0.5 as
Integer)) /144 as MyTotalFeet
HTH,
Set
At 12:02 18.03.2001 -0500, you wrote:
you don't say why your statement doesn't work and I guess the extra
parenthesis is just a typing mistake so it's not easy for us to suggest a
solution. But what happens if you try
select sum(cast(widthstring + 0.5 as Integer) * cast(heightstring + 0.5 as
Integer)) /144 as MyTotalFeet
HTH,
Set
At 12:02 18.03.2001 -0500, you 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