iven
asked on
sql ('LIKE')statement
Hi,this is my problem.i want to delete the whole record that the BN start with ABC,when i test this sql in MS Access it works:
DELETE FROM Employee
WHERE BN Like "ABC*"
example: BN
ABC123
ABC456
but error appear when i run it on VB.i try many way to replace the string of "ABC*" but failed.
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC* & "' " <<syntax error
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC% & "' " <<nothing selected
thanks!
DELETE FROM Employee
WHERE BN Like "ABC*"
example: BN
ABC123
ABC456
but error appear when i run it on VB.i try many way to replace the string of "ABC*" but failed.
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC* & "' " <<syntax error
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC% & "' " <<nothing selected
thanks!
Hi iven,
Try this instead:
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC & "%' "
Cheers
Try this instead:
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE '" & ABC & "%' "
Cheers
so, that's:
DELETE FROM Employee
WHERE BN Like "ABC%"
DELETE FROM Employee
WHERE BN Like "ABC%"
to: ryancys
It is not working in my sys.
mins is MS-Access2k.
kcm
It is not working in my sys.
mins is MS-Access2k.
kcm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
looks list quotes problem:
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE 'ABC%' "
sql = " SELECT * FROM Employee " & _
"WHERE BN LIKE 'ABC%' "
Iven u there.?
kcm76, Use "%" in VB, use "*" when debuging in M$ Access..
ASKER
THANKS!!!!!u r so great!
also thanks every one that answer the question to me.
also thanks every one that answer the question to me.
Delete * from Employee where bn like 'ABC*'
KCM