Comma as Decimal separator

B

Barry van Dijk

Using Access 2000 with SQL Server 2000.

I'm trying to insert a record into a table using a stored procedure
with a comma as decimal separator.

There is a textbox 'txtTariff' holding something like 1,234.
This will be stored as 1 ;-(

The field Tariff_NM is a Numeric(8,3) in SQL

The code (snippet) looks like this...

.Parameters.Append .CreateParameter("Tariff_NM", adNumeric, , ,
Me.txtTariff)
.Parameters("Tariff_NM").Precision = 8
.Parameters("Tariff_NM").NumericScale = 3

Any suggestions?
 
G

giorgio rancati

Barry van Dijk said:
Using Access 2000 with SQL Server 2000.

I'm trying to insert a record into a table using a stored procedure
with a comma as decimal separator.

There is a textbox 'txtTariff' holding something like 1,234.
This will be stored as 1 ;-(

The field Tariff_NM is a Numeric(8,3) in SQL

The code (snippet) looks like this...

.Parameters.Append .CreateParameter("Tariff_NM", adNumeric, , ,
Me.txtTariff)
.Parameters("Tariff_NM").Precision = 8
.Parameters("Tariff_NM").NumericScale = 3

Any suggestions?

The decimal separator in a textbox depend on regional setting.

Check the parameter datatype in stored procedure
----
Alter Procedyre dbo.MyProc
@Tariff_NM Numeric(8,3) --<<????
AS

UPDATE MYTABLE
SET Tariff_NM = @Tariff_NM
WHERE ................
 
B

Barry van Dijk

Barry van Dijk said:
messaggio news:[email protected]...

The decimal separator in a textbox depend on regional setting.

Check the parameter datatype in stored procedure
----
Alter Procedyre dbo.MyProc
@Tariff_NM Numeric(8,3) --<<????
AS

UPDATE MYTABLE
SET Tariff_NM = @Tariff_NM
WHERE ................

You're right! I've been looking at VBA all the time while the mistake was in
the SP. I declared it as just Numeric, without the (8,3). Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top