Solved

SQL String

Posted on 2002-04-18
4
177 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

803 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