Formatting Yes/No field in Union Query

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

Guest

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;
 
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
 
Back
Top