Re: Union query not working properly if no records exist

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 09/19/04


Date: Sat, 18 Sep 2004 19:15:20 -0600

On Fri, 17 Sep 2004 02:02:44 -0700, "Tony"
<anonymous@discussions.microsoft.com> wrote:

>I have designed a Union query (SQL copied below) to enable
>me to produce stats from the major tables in my DB. To
>get it to work properly I have to put a test record
>(blank) into certain tables for it to work correctly. How
>can I get it to work properly if no records exist in some
>tables, which is currently the case.

What is 'not working properly'? What result do you expect, and what
result are you getting?

A UNION query in which one of the SELECT clauses returns no records
"works" in the sense that it returns all the records from all the
other SELECTs; there is no error and no record returned for the empty
recordset. Is this not what you expect or need?

                  John W. Vinson[MVP]
             Join the online Access Chats
        Tuesday 11am EDT - Thursday 3:30pm EDT
      http://community.compuserve.com/msdevapps



Relevant Pages