Set to Null in Access query

I have a Date/Time, Number, and text field in one table, and want to reset them all to NULL.
Access gives me a "type conversion" error.  Any ideas what I am doing wrong?


update scratchoff set Reward = Null ,  Redeemed = Null, Email = Null where Email like '*r.com';
rrhandle8Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Is that the full SQL string you're trying to run? Can you show the full code snippet?
0
rrhandle8Author Commented:
Yes, that is the full string.  I changed from using % to using *, but that didn't work either.
0
Rey Obrero (Capricorn1)Commented:
try

update scratchoff set Reward = "" ,  Redeemed = "", Email = "" where Email like '*r.com';

for testing to find which field is giving the error, update the fields one at a time using three update queries

update scratchoff set Reward = Null where Email like '*r.com';

update scratchoff set Redeemed = Null where Email like '*r.com';

update scratchoff set  Email = Null where Email like '*r.com';
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Is the data stored in Access? Or in SQL Server (or some other server database)?
0
hnasrCommented:
Try: If using access,
DoCmd.RunSQL "update scratchoff set Reward = Null ,  Redeemed = Null, Email = Null where Email like ""*r.com"""

Open in new window

In SQL Null is inserted, and when viewed in access it shows blank.
0
Helen FeddemaCommented:
What data type is each field?  It may be better to save a zero-length string ("") to a text field, a 0 to a numeric field, and this peculiar value (representing an unselected date) to a Date field:

#12:00:00 AM#
0
rrhandle8Author Commented:
Rey, when I did it one field at a time, all three fields update.  Hmm.... wonder if there is a problem with updating multiple fields when one of the fields is included in the WHERE clause?  Anyways, thanks, I got the job done.
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
No, there's no trouble with update multiple fields based on any specific fields included in the WHERE clause.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.