Regional Setting may affect in query statement

Y

Yanto

Hi,

Is there anybody know how to fix this problem? I use query statement like
this:
SQLtext="INSERT INTO payroll (Emp_id, TotWorkingHour) VALUES (" & strEmp_ID
& "," & numTotWorkingHour & ");"
In client computer, they are using Regional setting (Indonesian), this
setting will effect in currency format like this "2,2" (in Indonesian
format). So when I execute the above query, the error will arise because the
number of values seems not same with the number of fields. I have tried to
use Format function ( as we use to reformat the date when deal with the
regional issue) but still error. This error will happen if for example
numTotWorkingHour = 1.4 (one point four)
Please give any comment.
TIA

Yanto
 
B

Bryan Reich [MSFT]

This is just a guess, I'm not currently set up with languages besides
english,
but it might work if you use conversion functions in your SQL as follows
(i.e. CCur(), CDbl()):

SQLtext="INSERT INTO payroll (Emp_id, TotWorkingHour) VALUES (" & strEmp_ID
& ",CDbl('" & numTotWorkingHour & "'));"
Since numTotWorkingHour is a fractional value (not really a currency though,
right? If it were a true currency field, you could use CCur instead)

Hope this works, but if not please feel free to post back and maybe someone
else can help out.
 

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