Want to export "True" or "False" not 1 or 0 to tet file.

P

Pat Coleman

I am exporting a table in Access 2003 to a text file which is imported in to
a third party appplication.

However, there are a few colums with "True" and "False" filelds but when
access generates the text file it replaces true and false with 1 and 0

I need it to export "True" or "False" as the third party application does
not accept 1 or 0

Is there any way to achieve this.

Thanks
 
J

John Spencer

You would have to export from a query and use a calculated field.

Field: SomeFieldTF: IIF(SomeYesNoField,"True","False")

Or as an alternative:
Field: SomeFieldTF: Format(SomeYesNoField,"True;True;False")

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John Spencer

That also works. I just could not recall the name of the built-in format.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
D

David W. Fenton

That also works. I just could not recall the name of the built-in
format.

"Also"? Your original doesn't give correct results, returning True
for every non-Null numeric value:

?Format(-1, "True;True;False")
True

?Format(0, "True;True;False")
True
 
J

John Spencer

Interesting, the format should work. Aha, I see my error now. I would have
to use
Format(SomeYesNoField,"\T\R\U\E;\T\R\U\E;\F\A\L\S\E")

That will return TRUE for any non-zero number, FALSE for Zero, and a zero
length string for nulls.

You are obviously correct that
Format(SomeYesNoField,"True/False")
works much better and is much simpler

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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