Formatting Yes/No field in Union Query

B

Bandit

I use the following query that is used in an ASP page. No matter if I
combine 2 querries into one, etc. I am still forced to search Yes/No using
0/-1. Does anyone know how to rewrite this so that doesn't happen? Everywhere
else it is Yes/No... Thanks


select ID,JobNumber,(select JobDescription from qryActiveJobs where
JobNumber=JobReports.JobNumber) as JobDescription, Name, Active
from JobReports
UNION ALL select 0 as ID,JobNumber, JobDescription, '' as Name, false as
Active from qryActiveJobs
ORDER BY JobNumber, ID;
 
M

Michel Walsh

Hi,


True and false are not native values. You can format them, if you wish:

iif( field , "True", "False")



Note that you don't need to supply aliases in the second SELECT (the one
following the UNION ALL), the alias, or fields names, that are kept are the
ones of the first SELECT.



Hoping it may help,
Vanderghast, Access MVP
 

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


Top