[Gambas-user] Can't exec an sql string

Benoit Minisini gambas at ...1...
Mon Oct 23 20:48:25 CEST 2006


On Monday 23 October 2006 15:39, Fabricio Silva wrote:
> Hello guys,
>
> I have this sql:  "select price from product order by cast (price as char)"
> When I execute this sql inside phpMyAdmin it comes with the right result.

Are you sure that is SQL standard, and not a phpMyAdmin feature?

> But when executing the sql inside Gambas 1.9.34 it comes with the error:
> "Query failde: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near('price, ....."
> I'm using price as varchar because in Brazil we use 147,00 instead of
> 147.00and I haven't figure out yet a way of showing the result with
> ","  whether
> than dot when I use decimal or float types.

If price is numeric, then you must use the Str() or Format() function to 
format the value according to your locale.

Regards,

-- 
Benoit Minisini





More information about the User mailing list