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!

Convert yes/no to bool for Excel export

Status
Not open for further replies.

roxannep

Technical User
Jun 20, 2000
69
0
0
I need to convert a yes/no field to it's Boolean equivalent prior to exporting to Excel.

Dilemma: I have a table I export to Excel. While the table shows -1 and 0 for the Yes/No entries in the table, once it exports to Excel, it changes to TRUE/FALSE based on the data in the table. I need to remain either -1/0 or 1/0. I need this to happen PRIOR to it getting into Excel as my next step is importing the spreadsheet into a program that can only read those fields as numeric. The users do not have enough experience to make those changes. Even running a small macro is asking much of them. So I would like to have it convert BEFORE I export it to Excel.

Is there a way to run an Update query on that field and change the format of the field? Or a built-in expression I can use?

Thank you for your help.
 
Use IIF() Function


Create a query with all the fields of the table and a new defined field like
Code:
YesNo: IIf([WinLoss]=True,1,0)
Replace "WinLoss" to your actual field name that hold Yes/No data.

________________________________________________________
Zameer Abdulla
Help to find Missing people
Take the first step in faith. You don't have to see the whole staircase, just take the first step.
(Dr. Martin Luther King Jr.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top