Solved

SQL String

Posted on 2002-04-18
4
178 Views
Last Modified: 2010-05-02
Hi,

I need to add lines to a table using the SQL instruction (e.g.) "INSERT INTO table (Customer, Cost) VALUES ('Company', 235,35)" Where 235,25 is the total amount for this company, for instance.
The problem is that in regional definitions i've set the comma (,) as the decimal simbol because i need that way to other apps and i can't change it and the VB generates an error because we have 2 fileds and 3 values. Of course the 235,35 is 235 units and 35 decimals.how can i handle this problem without changing Regional settings?
0
Comment
Question by:JParente
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
satj2000 earned 100 total points
ID: 6951978
You can simply use quotes!
Like this:
"INSERT INTO table (Customer, Cost)
VALUES ('Company', '235,35')"
Good Luck,
Ameen.
--------------------------------
Need cheap and reliable web hosting? Check out unlimitedhostingplans.com, sign up now and win a X-box!
0
 

Author Comment

by:JParente
ID: 6952043
It looks like very simple!!
Works fine, thanks!
0
 
LVL 1

Expert Comment

by:satj2000
ID: 6952049
You are welcome,
Good Luck,
Ameen.
--------------------------------
Need cheap and reliable web hosting? Check out unlimitedhostingplans.com, sign up now and win a X-box!
0
 
LVL 4

Expert Comment

by:nutwiss
ID: 6952256
BTW if you use a decimal 235.35, then SQL Server/ADO Provider will convert for any locality anyway...
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question