Converting data type

D

David Ewer

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
 
J

John Vinson

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]
 
Top