Reputation: 25272
I noticed that when transfering a query result from Access to Excel, whether by copy/paste or by using DoCmd.OutputTo
, True
/False
values become -1 or 0 in Excel.
I could of course write a VBA proc to fill the Excel but I was wondering: is there any trick I could use to make the simple transfer work? In other words, which value should I assign to the query column to get a proper True
/False
in Excel ?
I also noticed that in Excel, True is NOT equal to -1. It's not just a matter of formatting, like in Access.
Tried so far without success:
True
/False
in Access, but turns also in -1/0 in Excel Format
field property in the query to "True/False": same resultUpvotes: 0
Views: 1116
Reputation: 55921
In your query, you can use this expression to force a True/False string to Excel during export:
SpelledBoolean: Format([YourBooleanField], "True/False")
To return a 0 or 1, use Abs:
ZeroOneBoolean: Abs([YourBooleanField])
Upvotes: 1