I need to insert on orderline into a linked PostgreQL table using Access VBA. For easy reporting, I decided to include the netto price which is a Numeric 18,2 field. My computer has a Belgian period using comma as decimal separator. i.e. 0.8 is represented as 0,8
This is the problematic part if the insert statement
mijnSQL = "INSERT INTO tblOrderLijnen (OrderID, Nettoprijs )"
mijnSQL = mijnSQL & " VALUES (" & NieuwOrderId& "', " & MijnTempOrderLijn!Prijs * ((100 - Korting) / 100) & ");"
The result of the calculation is 0.8 (on my computer 0,8)
DoCmd.RunSQL mijnSQL
Translates into a query where the decimal value is invalid because the decimal point is a comma. How can I solve this?
INSERT INTO tblOrderLijnen (OrderID, OrderNr,ArtikelID,Aantal,Nettoprijs )
VALUES (216, 0,8);
Number of fields do not match
I changed the insert to quoting the decimal value. This seems to work, but is it valid? Can I run into problems later?
This is the problematic part if the insert statement
mijnSQL = "INSERT INTO tblOrderLijnen (OrderID, Nettoprijs )"
mijnSQL = mijnSQL & " VALUES (" & NieuwOrderId& "', " & MijnTempOrderLijn!Prijs * ((100 - Korting) / 100) & ");"