Board index » delphi » Currency Decimal Point in SQL

Currency Decimal Point in SQL

Hi
I need to insert rows in a table, with currency fiels, but
I am having trouble using decimal point.

exemple: I want to insert a line with Houston and 200.05 dollars,
but the value is passed to the SQL statement with the
decimal point defined in regional settings of control panel.

Insert into TABLE values ('HOUSTON',200,05)

The SQL sees 3 fiels instead of 2, and raises an error.

I do not want to depend of the settings in control panel,
because differents users may use differents configurations.

How can I format the currency value using "." as a decimal point,
independently of the regional settings of control panel?

Thanks
      Fernando Leme

 

Re:Currency Decimal Point in SQL


On 23 Dec 1999 12:12:04 GMT, "Fernando Leme" <f...@centroin.com.br>
wrote:

Quote
>I need to insert rows in a table, with currency fiels, but
>I am having trouble using decimal point.

>exemple: I want to insert a line with Houston and 200.05 dollars,
>but the value is passed to the SQL statement with the
>decimal point defined in regional settings of control panel.

>Insert into TABLE values ('HOUSTON',200,05)

Easiest solution is to use a parametrized query and let Delphi handle
the conversions for you.

Jan

Re:Currency Decimal Point in SQL


Quote
>I need to insert rows in a table, with currency fiels, but
>I am having trouble using decimal point.

>exemple: I want to insert a line with Houston and 200.05 dollars,
>but the value is passed to the SQL statement with the
>decimal point defined in regional settings of control panel.

>Insert into TABLE values ('HOUSTON',200,05)

Use formatFloat to format your numbers or use a parameter
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads