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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query to Opt-out

Status
Not open for further replies.

stocktondesigns

Technical User
Aug 31, 2003
16
US
I'm having a problem getting an Update Query to work. I would like to change the checkbox value of field called EmailOptin to 0 from 1, however, when I execute this I get the following message:

Query executed, however no records were found

This error doesn't make sense to me because I correctly qualified the table and field.

My SQL is:

UPDATE dbo.tblCustomers
SET EmailOptin = 0

Any ideas why this does not work.
 
Is this Access or SQL Server? Did you provide the full query?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Perhaps this ?
UPDATE dbo.tblCustomers
SET EmailOptin = False
WHERE EmailOptin = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried doing your recommendation PVH, but get the same error. It wouldn't take True/False values, these are checkbox fields that have 1 or 0. I'm trying to do this through MS Access since I do not have SQL. I can only display first 10,000 records. It looks like it does uncheck the opt-in value on all of these, however, I have another query that shows me all records where the customer has opted in, and there are thousands still checked. Do I need SQL to update this database?
 
A yes/no field in Access store -1 or 0. A table named "dbo.tblCustomers" suggests SQL Server is involved.

Are you attempting to run a pass-through query where the Returns Records is set to Yes?


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks Duane,
yes, I'm basically trying to update all records in this table to be opted out of our mailing list so I can send a re-invitation whereby they would then decide to opt-in if they want. I'm using MS Access to open the database (SQL). Not sure what I'm doing to be honest. Can't send out our re-invite out until the database has been correctly updated.
 
Apparently the table is linked from or resides in a SQL Server database. (yes or no)

You can create a pass-through query with sql like:
UPDATE tblCustomers
SET EmailOptin = 0
Or, if the table is linked, create the same query and run it.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top