SQL Union query

SQL Union query

am 09.04.2008 06:41:48 von hopciti

I've set up a Union query and when I run it I get asked to enter a
parameter value for one of the fields[State], not sure why and when I
enter a value it shows all values still which is what I want, I don't
really need to go through this though?

SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
[PostCode],[State],[Email]
FROM [tblRelatives]
WHERE [NMID] Is Not Null
UNION SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
[PostCode],[State],[Email]
FROM [tblStaff]
WHERE [NMID] Is Not Null;

Re: SQL Union query

am 09.04.2008 07:14:13 von Tom van Stiphout

On Tue, 8 Apr 2008 21:41:48 -0700 (PDT), hopciti
wrote:

Carefully check if that field occurs in both of the tables with that
exact spelling.
-Tom.


>I've set up a Union query and when I run it I get asked to enter a
>parameter value for one of the fields[State], not sure why and when I
>enter a value it shows all values still which is what I want, I don't
>really need to go through this though?
>
>SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
>[PostCode],[State],[Email]
>FROM [tblRelatives]
>WHERE [NMID] Is Not Null
>UNION SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
>[PostCode],[State],[Email]
>FROM [tblStaff]
>WHERE [NMID] Is Not Null;
>

Re: SQL Union query

am 09.04.2008 07:23:22 von hopciti

On Apr 9, 3:14=A0pm, Tom van Stiphout wrote:
> On Tue, 8 Apr 2008 21:41:48 -0700 (PDT), hopciti
> wrote:
>
> Carefully check if that field occurs in both of the tables with that
> exact spelling.
> -Tom.
>
>
>
> >I've set up a Union query and when I run it I get asked to enter a
> >parameter value for one of the fields[State], not sure why and when I
> >enter a value it shows all values still which is what I want, I don't
> >really need to go through this though?
>
> >SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
> >[PostCode],[State],[Email]
> >FROM [tblRelatives]
> >WHERE [NMID] Is Not Null
> >UNION SELECT [NMID],[Title], [Surname],[FirstName],[Address],[Suburb],
> >[PostCode],[State],[Email]
> >FROM [tblStaff]
> >WHERE [NMID] Is Not Null;- Hide quoted text -
>
> - Show quoted text -

Thanks Tom

Pointed me in right direction silly me didn't even have 'State' in the
tblStaff because all the staff live in the same state, easy fixed,
thanks again