similar problem to apostrophe in INSERT INTO stmts

Results 1 to 2 of 2

Thread: similar problem to apostrophe in INSERT INTO stmts

  1. #1
    Join Date
    Dec 1969
    Posts
    38

    Default similar problem to apostrophe in INSERT INTO stmts

    In Spain we use comma instead of a point for decimals. Trying to update a table in a database where one of the fields is a decimal number gives me the error that there are more values than fields in the table. My guess is that this is because of the comma in the number.<BR>The problem looks similar to what happens with apostrophes in user imput.<BR>I&#039m not sure how I could solve this problem and I haven&#039t seen any examples. Any suggestions would be appreciated.

  2. #2
    Join Date
    Dec 1969
    Posts
    38

    Default Found a solution, but not quite...

    I have found a VBScript FUNCTION that would replace the "," for a "." <BR>Howver I am faced with the problem that once you run into large numbers, the comma for the thousands is also replaced by ".", which gives me an error.<BR>How can I modify this function so it modifies the decimal point but not the thousands? could anyone help me out? thanks...<BR><BR>&#060;SCRIPT LANGUAGE=VBScript RUNAT=Server&#062;<BR><BR>FUNCTION ReplaceComma (s)<BR> pos = InStr(s, ",")<BR> if pos &#062; 0 then<BR> s = Mid(s, 1, pos - 1) & "." & Mid(s, pos + 1)<BR> end if<BR> ReplaceComma = s<BR>END FUNCTION<BR>&#060;/SCRIPT&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •