I hate syntax.... SQL question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get the data mismatch when I run this SQL. SKU and rs1!SKU are the same
type, text, however it contains numeric (if this matters). Any help would be
appreciated.

vSql2 = "SELECT PART_DESC FROM VIAWARE_USER_XPM_F WHERE SKU = " & rs1!sku & ""

I've also tried:

SKU = rs1!sku
SKU = "rs1!sku"
 
WHERE SKU = '" & rs1!sku & "'"

That's a single quote followed by a double quote after the '=' and a single
quote between two double quotes at the end.
 
Thanks!

Brendan Reynolds said:
WHERE SKU = '" & rs1!sku & "'"

That's a single quote followed by a double quote after the '=' and a single
quote between two double quotes at the end.
 
Mark said:
I get the data mismatch when I run this SQL. SKU and rs1!SKU are the same
type, text, however it contains numeric (if this matters). Any help would be
appreciated.

vSql2 = "SELECT PART_DESC FROM VIAWARE_USER_XPM_F WHERE SKU = " & rs1!sku & ""


After the concatenation, the result must have text values
(the SKU value) enclosed in quotes. To do that you need to
double up on the quotes inside the outer quotes:


vSql2 = "SELECT . . . WHERE SKU = """ & rs1!sku & """"
 
Back
Top