[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Return multiple values in select union query....

Posted on 2006-07-05
3
Medium Priority
?
228 Views
Last Modified: 2012-08-14
I have the following line (followed by many similar), but I want to return not only the missing field and the Account Title, but also the account number...what do I need to change to return (Account#) for the query??

Current: select "Account" as MissingField, [AccountTitle] from [RIA Accounts] where IsNull([Account]) UNION ....etc...
0
Comment
Question by:m7johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 200 total points
ID: 17046281
just add it into your query

select [Account#] , [AccountTitle] from [RIA Accounts] where IsNull([Account])


now remember, all queries in your union statement must return the same number of columns
so since this is in the first column, if subsequent queries dont have it, add in the missing column, like u did

select [Account#] , [AccountTitle] from [RIA Accounts] where IsNull([Account])
union
select '' as something, ...

0
 

Author Comment

by:m7johnson
ID: 17046312
i thought i had tried that already, I kept thinking "why is this not working".......regardless thanks
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17046317
no probs
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question