Subject |
Re: sql decimals |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Mon, 8 Jan 2024 08:31:38 +0200 |
Newsgroups |
dbase.getting-started |
On 2024/01/08 00:25, Charlie wrote:
> 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?
The SQL function to change a column's type is CAST().
sql = "select cast(sum(qty) as int) as qty from collection"
It's optional but if you don't include the "as qty" in the statement the
field in the rowset will be named "SUM of qty"
Mervyn.
|
|