Re: Union and variable



Hi,


Either ThisWeek is not part of [qGoals Tracking - This Week's CO Books] or
of [qGoals Tracking - 1 Week Ago CO Books]; either ThisWeek is a parameter
inside one of the otehr queries. Check typo, specifically. In other words,
try:


Select NumberBooked, ThisWeek From [qGoals Tracking - This Week's CO Books]



all alone. Same with



Select NumberBooked, ThisWeek From [qGoals Tracking - 1 Week Ago CO Books]



Hoping it may help,
Vanderghast, Access MVP


"Rod" <Rod@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE06E245-8A1D-47C5-8DE2-C1D78A3B7E1C@xxxxxxxxxxxxxxxx
> Hello,
>
> I have a series of queries which look similar to:
>
> SELECT tblCandidates.Booked, Count(tblCandidates.Booked) AS NumberBooked,
> Weekday([Booked]) AS WedOnly
> FROM tblCandidates
> GROUP BY tblCandidates.Booked, Weekday([Booked])
> HAVING (((tblCandidates.Booked)>=Date()-7) AND ((Weekday([Booked]))=4));
>
> and
>
> SELECT [qGoals Tracking - All Weekly CO Books].ThisWeek, [qGoals
> Tracking -
> All Weekly CO Books].NumberBooked
> FROM [qGoals Tracking - All Weekly CO Books]
> WHERE ((([qGoals Tracking - All Weekly CO Books].ThisWeek)=[qGoals
> Tracking
> - All Weekly CO Books]![BegOfWeek]));
>
> I have a union query which looks like this:
>
> Select NumberBooked, Booked From [qGoals Tracking - 1Sun CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 2Mon CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 3Tue CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 4Wed CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 5Thu CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 6Fri CO Books] Union
> Select NumberBooked, Booked From [qGoals Tracking - 7Sat CO Books] Union
> Select NumberBooked, ThisWeek From [qGoals Tracking - This Week's CO
> Books]
> UNION
> Select NumberBooked, ThisWeek From [qGoals Tracking - 1 Week Ago CO
> Books];
>
> When I run this last query I get a dialog box asking for a Parameter Value
> for "ThisWeek". My goal is to pulls all of this information into a single
> query so I can use the query for a report. I'm stuck as to how to get
> over
> this hurdle.
>
> Thanks for your help.


.