Import an Excel yes/no field

V

vtj

I'm using Office 2007. I have an Excel sheet in .xls format that has an
yes/no field. When I try to import that field along with the rest of the
sheet into Access, even if I set the data type for that field at yes/no in
the Access import screens, I get a 'type conversion error.' Is there a way
to import this data as a yes/no or true/false or anything that would indicate
the setting that exists in the Excel sheet? Does some sort of Macro that
converts the data to something else need to run in Excel first and then an
update query in Access to accomplish this? It is the value of the field not
the fact that it is a yes/no field that is important.
 
K

Ken Snell \(MVP\)

Import the sheet's data to a temporary table, then use an append query to
copy the data to the permanent table -- and in that append query, convert
the YES values to -1 and NO values to 0.

YesNoFieldName: IIf(FieldName = "YES", -1, 0)
 

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