Re: Storing Doubles in SQL



You don't want the string delimiters. Do something like;

INSERT INTO Employees
(EmployeeID, FirstName, LastName)
VALUES (9999, N'John', N'Smith')


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"naive14" wrote:
Thanks. So I'll use a Double definition in my sql database.

As to the second part of the question, should I convert the double to a string and format as in :

dim s, sqlCMD as string
dim d as double

d = 5459.459
s = Format(d, "##,##0.00")

sqlCMD = "INSERT INTO tablex VALUES ('" & s & "')
' the above probably rounds off to 2 decimals


or is this valid ...

sqlCMD = "INSERT INTO tablex VALUES ('" & d & "')
.



Relevant Pages

  • Re: Retrieving data from query using If, Then, Else
    ... Private Sub Form_Current ... Dim s As String ... Dim rs As DAO.Recordset ... I am currently using the following code to retrieve each employees ...
    (microsoft.public.access.formscoding)
  • Re: Listbox with selection of start and end date
    ... it shows all employees, so I am missing something somewhere. ... Private Sub CmdPrintEmplData_Click ... Dim varSelected As Variant ... Dim strWhere As String ...
    (microsoft.public.access.formscoding)
  • Re: OOP Inheritance
    ... I have a Company Object and a company has employees (one to many ... Public Property CompanyIDAs String ... Public ReadOnly Property Employees() As ArrayList ... Public Sub New(ByVal DeductionID As String) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Create Structure
    ... Dim Phone As Integer ... Dim Country As String ... Then I could create a list of Employees ... Then what happens when I added it to an array? ...
    (comp.soft-sys.matlab)
  • Re: Separating pages (template) into individual files
    ... Dim docName As String ... the person who created it instead placed all 200 employees' info ... template for each of the 200 employees into a single file for each ...
    (microsoft.public.word.docmanagement)