Format Yes/No fields after Union

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 tables which have a field whose value is either Yes or No.
After performing a UNION query on both these tables the corresponding
resuting field shows a value of -1 for Yes and 0 for No.
I'm not being able to format that to Yes or No.
I need to export these results to a text file.

Kindly help.
Thanks.
DS.
 
DD said:
I have 2 tables which have a field whose value is either Yes or No.
After performing a UNION query on both these tables the corresponding
resuting field shows a value of -1 for Yes and 0 for No.
I'm not being able to format that to Yes or No.
I need to export these results to a text file.

A Yes/No field is stored as -1/0, the "Yes" and "No" are
just presentation formatting.

Try using the format function in the field:

SELECT somefield, Format(YNfield, ";\Y\e\s;\N\o")
FROM tableA
UNION
SELECT somefield, Format(YNfield, ";\Y\e\s;\N\o")
FROM tableB
 

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

Similar Threads

Format Yes/No in Union 4
UNION, WHERE or Something else? 3
Union Query 4
Union Query Help 0
Union query 5
Currency Format Lost in Union Query 1
yes/no field format 1
UNION question 3

Back
Top