Query Failure

A

Abay

I'm pretty much a newbie & am struggling with a failure in a query to update
a "Yes/No" field .. here's the SQL Code:

UPDATE [test client] SET [test client].Dep_rec_ind = "Yes"
WHERE ((([test client].Dep_amt_rec)>0));

Dep_rec_ind is defined as a "yes/No" Field
Dep_amt_rec is a "Currency" Field

The Query correctly selects the five rows which fit the criteria but then
gives an error message stating the query failed "due to a type conversion
failure".

Any help would be much appreciated.

Maggic
 
A

Allen Browne

Replace
"Yes"
with:
True

The word in quotes attempts to assign a piece of text to a yes/no field.
Assigning the value True or False should work, i.e.:
UPDATE [test client] SET [test client].Dep_rec_ind = True
WHERE ((([test client].Dep_amt_rec)>0));
 
A

Abay

Should have figured that out!

Many thanks,
Maggic


Allen Browne said:
Replace
"Yes"
with:
True

The word in quotes attempts to assign a piece of text to a yes/no field.
Assigning the value True or False should work, i.e.:
UPDATE [test client] SET [test client].Dep_rec_ind = True
WHERE ((([test client].Dep_amt_rec)>0));

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Abay said:
I'm pretty much a newbie & am struggling with a failure in a query to
update
a "Yes/No" field .. here's the SQL Code:

UPDATE [test client] SET [test client].Dep_rec_ind = "Yes"
WHERE ((([test client].Dep_amt_rec)>0));

Dep_rec_ind is defined as a "yes/No" Field
Dep_amt_rec is a "Currency" Field

The Query correctly selects the five rows which fit the criteria but then
gives an error message stating the query failed "due to a type conversion
failure".

Any help would be much appreciated.

Maggic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top