Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT works but not the UPDATE using LIKE % ? 1

Status
Not open for further replies.

denoxis

Programmer
Jul 22, 2002
154
US
Hi,

I have this strange problem.
In Access 2002, I have linked tables to SQL2000. Basically I can do any kind of query on those tables just like they're an Access table.

The other day, I needed to update the fields on this table:

product_sku text(50)
product_available yes/no
product_visible yes/no

First I used a select query to see what I'm going to update :

SELECT product_sku, product_available, product_visible FROM tbl_products WHERE product_sku like '%-X-??0-%';

So it returned something like:

A1-X-110-XCV -1 -1
B2-X-210-VBN 0 -1
C3-X-320-QWA -1 0
D4-X-560-TYU -1 -1

Then I changed it to an UPDATE query and double checked the SQL syntax:

UPDATE tbl_products SET product_visible = 1 WHERE product SKU Like '%-X-??0-%';

It tells me that 0 Rows are going to be updated. The Answer Yes or No didn't change anything - nothing was updated.

Can't we use ? in update queries?




 
Actually, there is no need anymore.
I used Enterprise Manager directly.
 
You might want to try Access wildcards rather than SQL Server wildcards. Also, your linked SQL Server must have a primary key or Access won't update it.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top