Subject | Re: How to cast a float? |
---|---|
Author | phil_hhn |
Post date | 2004-09-13T05:45:49Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
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
wrote:
> Casting anythinng AS CHAR you are asking for a single byte string.first to
> 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,
> 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 DeprRateThanks Helen, worked like a charm - so easy when you are shown the
>
> ./heLen
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