Criteria

M

margaret

I have a query:

SELECT [qrygame companison cross-tab].game, gamemaster.gname, [qrygame
companison cross-tab].game, [qrygame companison cross-tab].DAYOFFAIR,
[qrygame companison cross-tab].[2008], [qrygame companison cross-tab].[2009]
FROM gamemaster INNER JOIN [qrygame companison cross-tab] ON gamemaster.game
= [qrygame companison cross-tab].game
WHERE ((([qrygame companison cross-tab].DAYOFFAIR)=[Day of Fair?]));

However, it keeps say it does not recognize "Day of Fair?" as a valid field
name or expression.

Any help would be appreciated.
 
M

MGFoster

margaret said:
I have a query:

SELECT [qrygame companison cross-tab].game, gamemaster.gname, [qrygame
companison cross-tab].game, [qrygame companison cross-tab].DAYOFFAIR,
[qrygame companison cross-tab].[2008], [qrygame companison cross-tab].[2009]
FROM gamemaster INNER JOIN [qrygame companison cross-tab] ON gamemaster.game
= [qrygame companison cross-tab].game
WHERE ((([qrygame companison cross-tab].DAYOFFAIR)=[Day of Fair?]));

However, it keeps say it does not recognize "Day of Fair?" as a valid field
name or expression.

Any help would be appreciated.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is [Day of Fair?] a date? If so, try this:

PARAMETERS [Day of Fair?] Date;
SELECT Q.game, G.gname, Q.DAYOFFAIR, Q.[2008], Q.[2009]
FROM gamemaster As G INNER JOIN [qrygame companison cross-tab] As Q ON
G.game = Q.game
WHERE Q.DAYOFFAIR=[Day of Fair?];

Sometimes Access likes us to explicitly declare dates, otherwise, it may
be translated as a mathematical expression.

Also, you had 2 instances of Q.game in the SELECT clause - nothing earth
shattering, but why waste bandwidth?

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBStVHOIechKqOuFEgEQKBzgCgwqbmqF98Q+/hlk33ytLUDMl39cAAoLf4
jVq/xXp/vxuOEP7spqOkrsqt
=jT7w
-----END PGP SIGNATURE-----
 
S

S.Clark

Explicitly add it to the Query Parameters list.
I recommend you dump the question mark, but keep it if the above works.
 
J

Jerry Whittle

Looks like [Day of Fair?] is a parameter. It also looks like this query is
based on a crosstab query. With the newer versions of Access, the data type
of a parameter must be declared when used by a crosstab. It's usually best
to put the parameter, and declare it, in a regular select query then base the
crosstab on this first query.

If you look at the SQL for this first query, it should have a first line
something like:

PARAMETERS [Day of Fair?] DateTime;

Even though the parameter is in the first query, it still ask for it when
you run the crosstab. However you have a third query based on the crosstab
and I've never tried that myself.
 
K

KARL DEWEY

I assume that [Day of Fair?] is meant to be a parameter. That is the problem
with using spaces and other non-letter characters.
Add this above your SELECT statement in the query SQL --
PARAMETERS [Day of Fair?] DateTime;

So it looks like this ---
PARAMETERS [Day of Fair?] DateTime;
SELECT [qrygame companison cross-tab].game, gamemaster.gname, [qrygame
companison cross-tab].DAYOFFAIR, .....

NOTE -- I removed the second - [qrygame companison cross-tab].game,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top