Converting data type

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access database where the data source is a number of tables linked
to several DBF files and an Excel spreadsheet.

One field in my Excel spreadsheet contains several results (with "Y" or "N"
answers). I have used the LEFT expression in a query to split this field into
8 seperate fields.

I would like these fields to appear as tick boxes on a form however the data
type is "Text". How can I change the data type for the 8 new fields in my
query to "Yes/No"?

If it is possible to do this, can these procedure be automated?

Thanks

David
 
I have an Access database where the data source is a number of tables linked
to several DBF files and an Excel spreadsheet.

One field in my Excel spreadsheet contains several results (with "Y" or "N"
answers). I have used the LEFT expression in a query to split this field into
8 seperate fields.

I would like these fields to appear as tick boxes on a form however the data
type is "Text". How can I change the data type for the 8 new fields in my
query to "Yes/No"?

So it's a text field with contents such as YYNYNYYN?

If so you can put in eight calculated fields:

YesNo1: Mid([fieldname], 1, 1) = "Y"
YesNo2: Mid([fieldname], 2, 1) = "Y"

and so on. I'd suggest having a local Access table with yes/no fields
and running an Append query from the linked spreadsheet; the
calculated fields I describe will probably be slow.

John W. Vinson[MVP]
 

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

Back
Top