0

Similar to CONCAT equivalent in MS Access, I want to insert a string including a percentage symbol. INSERT INTO Financier_Fp_line (FP_Id, Item_, Creditor, Description, Payment_Type, Actual_Amount, Note_) VALUES ( '86', '2', "", 'BFA 10%', "Set-aside", '20', '' ) is not working. My original text was BFA 10%. I've tried concatenating as above using "+" and "&". I get the same error with each method.

Data type mismatch in criteria expression.

Any clues anyone?
Edit 2019.05.10: In re-creating the sql (as requested, now shown above), either oledb or Access itself decided to not interpret the % as a wild-card, and the insert is working fine. Go figure.
Thanks people.

  • 1
    Please include all columns and data. The error message you are seeing is saying that one or more of the types you are inserting does not match with the type defined for that column. It may have nothing to do with your current perception. – Tim Biegeleisen May 05 '19 at 05:58

2 Answers2

0

This will work:

INSERT INTO myTable (myFields)
VALUES (myValue1,...,'Bfa 10%')

and:

INSERT INTO myTable (myFields)
VALUES (myValue1,...,'Bfa 10' & Chr(37))
Gustav
  • 53,498
  • 7
  • 29
  • 55
0

This should work:

select . . . , "Bfa 10" & "%"

I'm not sure why you would want to do this instead of the simpler "Bfa 10%", but that should work as well.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786