Subject Re: How to cast a float?
Author phil_hhn
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> Casting anythinng AS CHAR you are asking for a single byte string.
> i.e. AS CHAR and AS CHAR(1) mean the same thing.
>
> If you don't want a gazillion figures after, then double cast it,
first to
> numeric(5,3) and then to a varchar of suitable size.
>
> select cast(cast(depreciation_rate as numeric(5,3)) as varchar(7))
|| '%'
> from my_table as DeprRate
>
> ./heLen

Thanks Helen, worked like a charm - so easy when you are shown the
right way :-)

BTW, does FB support the LENGTH function in SQL? I.e for a char or
varchar column called "my_string", something like:

select my_pk from my_table where length(my_string) > 2

?
Thanks v. much