Comma as decimal separator

G

Guest

For the US among others the decimal symbol is a dot. Many countries, mine
with them, is using a comma instead. Now, when performing an SQL query with a
decimal number as an argument with the decimal symbol being a comma, the
query will fail: "Syntax error (comma) in query expression"
If I go to Control Panel -> >Regional and Language Options->Customize and
change the comma to a dot, the query will work as expected. However, running
the application on another computer would require this change as well. I'd
like to avoid Quick and Dirty solutions. I've tried to manually enter a dot
as the separator but Access just removes it making 2.3 become 23.
I'm using Swedish MS Access 2003 with US English XP SP2, always upgraded
with the lastest hotfixes. Is there a way to make Access honour the Regional
settings (Swedish)?
Regards
Peter
 
S

Stefan Hoffmann

hi Peter,
For the US among others the decimal symbol is a dot. Many countries, mine
with them, is using a comma instead. Now, when performing an SQL query with a
decimal number as an argument with the decimal symbol being a comma, the
query will fail: "Syntax error (comma) in query expression"
This is only true, when you rely on automatic converts using only string
concatenation. You need to use explicitly CStr().


mfG
--> stefan <--
 
G

Guest

"Stefan Hoffmann" skrev:
This is only true, when you rely on automatic converts using only string
concatenation. You need to use explicitly CStr().
What I need to do is use an SQL expression in a form to select certain
records. When I input a decimal value from a text box in the form it requires
me to use the comma. That value is then used in a dynamically build SQL
expression, which will not run as the number contains a comma. As I stated in
my original post I cannot use a dot in the input field as Access is removing
the dot.
Hope that makes it a bit more clear.
 
S

Stefan Hoffmann

hi Peter,
As I stated in
my original post I cannot use a dot in the input field as Access is removing
the dot.
This may be either auto-correction or code behind your text box or an
input mask.


mfG
--> stefan <--
 

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