Subject |
Re: sql decimals |
From |
Heinz Kesting <Nobody@Nowhere.com> |
Date |
Sun, 7 Jan 2024 23:40:09 +0100 |
Newsgroups |
dbase.getting-started |
Hi Charlie,
> sql = "select sum(qty) from collection
>
> The sun(qty) generates decimals and zeros like this.. 9.00. I would
like it to look like this. 9
>
> I have tried round() in the sql which doesn't seem to work. I have
also tried to find a way in properties but I can't seem to fix this
which I would think should be easy. Any suggestions?
I wouldn't tackle this in SQL, but you could try using INT() or
TRANSFORM(). These are dBase functions, so you could use these to
display the value. However, INT() returns a numeric value, so you might
need to convert it to a string and finally left-trim it like
ltrim(str(int(your_numeric_value)))
There may be other and better ways, just a quick thought ...
Hope I could give you a start.
Kind regards, Heinz
|
|