Re: Union Two Tables with Different number of columns



Place the table that has more fields first, and add a calculated field to
make up for the missing one.

Example:
SELECT F1, F2, F3 FROM Table1
UNION ALL
SELECT F1, F2, Null As F3 FROM Table2;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"majed via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:0d24f83f3f03469ebc83f469c5572c95@xxxxxxxxxxxxxxxxxxxx
> Hi,
> How can I select a union record set from two tables while having different
> number of columns?


.



Relevant Pages

  • Re: Report with subreport and input parameters
    ... No subform involved. ... > I was prompted for State once, but the union query didn't bring back the ... rather than allenbrowne at mvps dot org. ... >>> WHERE clauses. ...
    (microsoft.public.access.reports)
  • Re: Updatable Union Query
    ... No. UNION queries are never updatable. ... adding an extra field to indicate whatever difference is intended by having ... rather than allenbrowne at mvps dot org. ... > this doesn't work with a union query. ...
    (microsoft.public.access.queries)