[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Return multiple values in select union query....

Posted on 2006-07-05
3
Medium Priority
?
229 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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

831 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