Import an Excel yes/no field

  • Thread starter Thread starter vtj
  • Start date Start date
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.
 
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)
 
Back
Top