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

Null to text/Number 2

Status
Not open for further replies.

robdunfey

Technical User
Apr 26, 2002
110
0
0
GB
Hi,

I have a table with some text and some yes/no fields. I would like to turn the yes/no fields into text fields. Where an answer was yes when the field was a yes/no field I want it to be a "1" in the text field. Any suggestions on if this is possible? This doesnt have to be done in VBA? Any code, suggestions, much appreciated.

Rob
 
Hi,
If you just go and change the field's data type from yes/no in text, you'll have "yes" and "no" as values in your field. From there, if you want to have let's say "1" for YES and "2" for NO, you can run an update query. Doesn't have to be done in VBA.

If you want to keep the original table with yes/no it's a bit different.

Let me know,
Gabriela.
 

you can try the above in a small sample table, to see how it works and to be sure you're not loosing your data!
 
You could put the conversion in the select statement. Remember that in Access a -1 is Yes and 0 is No.

select iif(youryesno=-1,1,0) as YesNo from table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top