Subject Re: [IBDI] SQL Help
Author Brian Muegge
Charlie wrote:

> 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.

Charlie,

What is the actual error message that you're getting? At first glance, I'd
guess that the problem is the "trunc" function, which is part of Delphi, but
which is not part of the standard user-defined function (UDF) library that
is included with Interbase. Unless you have installed an additional UDF
library that includes the trunc function, Interbase won't know what to do
with it. Although I haven't used it myself, you might want to get a copy of
"FreeUDFLib", which I think includes some rounding and truncating functions.

Hope that helps,

Brian

P.S. - It also looks like you have an extra closing parenthesis on your sum.