Solved

Return multiple values in select union query....

Posted on 2006-07-05
3
224 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 50 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

766 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