Can't run a query - can anyone help?!

H

HeatherG

I've jsut built a new database and I need to split the information on
it into 2 sections - pre-christmas and post-christmas. On the database
I have a field that contains information about the venue delegates will
be invited to which contains the city, venue name, date and times they
will be attending. I've tried to run a query with the criteria
"Leeds"Or"Hull" etc etc but it doesn't give me any results. Can anyone
tell me what I'm doing wrong, or if it is a glitch in the
ever-so-wonderful world of Microsoft. Thanks....
 
F

fredg

I've jsut built a new database and I need to split the information on
it into 2 sections - pre-christmas and post-christmas. On the database
I have a field that contains information about the venue delegates will
be invited to which contains the city, venue name, date and times they
will be attending. I've tried to run a query with the criteria
"Leeds"Or"Hull" etc etc but it doesn't give me any results. Can anyone
tell me what I'm doing wrong, or if it is a glitch in the
ever-so-wonderful world of Microsoft. Thanks....

You'll have to post the Where clause of your query SQL.
Copy and Paste.
 
H

HeatherG

Not sure what you mean. Can you explain please? Thanks (and sorry for
being dim)
 
F

fredg

Not sure what you mean. Can you explain please? Thanks (and sorry for
being dim)

Open your query in design view.
Click on View + SQL View
If your SQL is only a few lines, select the entire SQL and Copy it.
If the SQL is long, find the line (near the end) that begins
Where ....
Highlight everything after that (including the Where).
Copy it.
Then paste it into a reply to this message.
 
H

HeatherG

SELECT [Bookings Sheet].[Children's Centre Name], [Bookings
Sheet].[Local Authority], [Bookings Sheet].[Suggested Training Venue]
FROM [Bookings Sheet]
WHERE ((([Bookings Sheet].[Suggested Training Venue])="Leeds" Or
([Bookings Sheet].[Suggested Training Venue])="Hull" Or ([Bookings
Sheet].[Suggested Training Venue])="Liverpool" Or ([Bookings
Sheet].[Suggested Training Venue])="Coventry" Or ([Bookings
Sheet].[Suggested Training Venue])="Nottingham" Or ([Bookings
Sheet].[Suggested Training Venue])="Newcastle" Or ([Bookings
Sheet].[Suggested Training Venue])="Winchester" Or ([Bookings
Sheet].[Suggested Training Venue])="London"));


Hope that's right - thanks for your help so far!
 
F

fredg

SELECT [Bookings Sheet].[Children's Centre Name], [Bookings
Sheet].[Local Authority], [Bookings Sheet].[Suggested Training Venue]
FROM [Bookings Sheet]
WHERE ((([Bookings Sheet].[Suggested Training Venue])="Leeds" Or
([Bookings Sheet].[Suggested Training Venue])="Hull" Or ([Bookings
Sheet].[Suggested Training Venue])="Liverpool" Or ([Bookings
Sheet].[Suggested Training Venue])="Coventry" Or ([Bookings
Sheet].[Suggested Training Venue])="Nottingham" Or ([Bookings
Sheet].[Suggested Training Venue])="Newcastle" Or ([Bookings
Sheet].[Suggested Training Venue])="Winchester" Or ([Bookings
Sheet].[Suggested Training Venue])="London"));

Hope that's right - thanks for your help so far!
Open your query in design view.
Click on View + SQL View
If your SQL is only a few lines, select the entire SQL and Copy it.
If the SQL is long, find the line (near the end) that begins
Where ....
Highlight everything after that (including the Where).
Copy it.
Then paste it into a reply to this message.

The Query SQL you posted here is asking for records for certain
cities, i.e. "Leeds", "Hull" ... etc.... "London". There is no other
criteria being called for.
It looks OK.
If the value in the [Suggested Training Venue] field is one of those
cities, that record should be returned in the query .... UNLESS the
actual datatype of the [Suggested Training Venue] field is not Text
but Number, i.e. the field is a number datatype, and a combo box is
used to select the city on your Form but the bound column of the
combo box is a Number Prime Key value.
So, you will see "Leeds" but the actual value stored in the table is
the Prime Key field value (a number), i.e. 12.

In this case either change each value in the Where clause to it's
Prime Key value equivalent:
WHERE ((([Bookings Sheet].[Suggested Training Venue])=12 Or
([Bookings Sheet].[Suggested Training Venue])= 18 Or ... etc.

Or...
include the City table in the query. Make sure the relationships are
correct, and use that City table in the where clause instead of
[Booking Sheet].
 
H

HeatherG

All sorted now. Thanks for all your help!
SELECT [Bookings Sheet].[Children's Centre Name], [Bookings
Sheet].[Local Authority], [Bookings Sheet].[Suggested Training Venue]
FROM [Bookings Sheet]
WHERE ((([Bookings Sheet].[Suggested Training Venue])="Leeds" Or
([Bookings Sheet].[Suggested Training Venue])="Hull" Or ([Bookings
Sheet].[Suggested Training Venue])="Liverpool" Or ([Bookings
Sheet].[Suggested Training Venue])="Coventry" Or ([Bookings
Sheet].[Suggested Training Venue])="Nottingham" Or ([Bookings
Sheet].[Suggested Training Venue])="Newcastle" Or ([Bookings
Sheet].[Suggested Training Venue])="Winchester" Or ([Bookings
Sheet].[Suggested Training Venue])="London"));

Hope that's right - thanks for your help so far!
On 1 Jun 2006 06:07:17 -0700, HeatherG wrote:

Not sure what you mean. Can you explain please? Thanks (and sorry for
being dim)
fredg wrote:
On 31 May 2006 04:56:25 -0700, HeatherG wrote:

I've jsut built a new database and I need to split the information on
it into 2 sections - pre-christmas and post-christmas. On the database
I have a field that contains information about the venue delegates will
be invited to which contains the city, venue name, date and times they
will be attending. I've tried to run a query with the criteria
"Leeds"Or"Hull" etc etc but it doesn't give me any results. Can anyone
tell me what I'm doing wrong, or if it is a glitch in the
ever-so-wonderful world of Microsoft. Thanks....

You'll have to post the Where clause of your query SQL.
Copy and Paste.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Open your query in design view.
Click on View + SQL View
If your SQL is only a few lines, select the entire SQL and Copy it.
If the SQL is long, find the line (near the end) that begins
Where ....
Highlight everything after that (including the Where).
Copy it.
Then paste it into a reply to this message.

The Query SQL you posted here is asking for records for certain
cities, i.e. "Leeds", "Hull" ... etc.... "London". There is no other
criteria being called for.
It looks OK.
If the value in the [Suggested Training Venue] field is one of those
cities, that record should be returned in the query .... UNLESS the
actual datatype of the [Suggested Training Venue] field is not Text
but Number, i.e. the field is a number datatype, and a combo box is
used to select the city on your Form but the bound column of the
combo box is a Number Prime Key value.
So, you will see "Leeds" but the actual value stored in the table is
the Prime Key field value (a number), i.e. 12.

In this case either change each value in the Where clause to it's
Prime Key value equivalent:
WHERE ((([Bookings Sheet].[Suggested Training Venue])=12 Or
([Bookings Sheet].[Suggested Training Venue])= 18 Or ... etc.

Or...
include the City table in the query. Make sure the relationships are
correct, and use that City table in the where clause instead of
[Booking Sheet].
 
H

HeatherG

All sorted now. Thanks for all your help!
SELECT [Bookings Sheet].[Children's Centre Name], [Bookings
Sheet].[Local Authority], [Bookings Sheet].[Suggested Training Venue]
FROM [Bookings Sheet]
WHERE ((([Bookings Sheet].[Suggested Training Venue])="Leeds" Or
([Bookings Sheet].[Suggested Training Venue])="Hull" Or ([Bookings
Sheet].[Suggested Training Venue])="Liverpool" Or ([Bookings
Sheet].[Suggested Training Venue])="Coventry" Or ([Bookings
Sheet].[Suggested Training Venue])="Nottingham" Or ([Bookings
Sheet].[Suggested Training Venue])="Newcastle" Or ([Bookings
Sheet].[Suggested Training Venue])="Winchester" Or ([Bookings
Sheet].[Suggested Training Venue])="London"));

Hope that's right - thanks for your help so far!
On 1 Jun 2006 06:07:17 -0700, HeatherG wrote:

Not sure what you mean. Can you explain please? Thanks (and sorry for
being dim)
fredg wrote:
On 31 May 2006 04:56:25 -0700, HeatherG wrote:

I've jsut built a new database and I need to split the information on
it into 2 sections - pre-christmas and post-christmas. On the database
I have a field that contains information about the venue delegates will
be invited to which contains the city, venue name, date and times they
will be attending. I've tried to run a query with the criteria
"Leeds"Or"Hull" etc etc but it doesn't give me any results. Can anyone
tell me what I'm doing wrong, or if it is a glitch in the
ever-so-wonderful world of Microsoft. Thanks....

You'll have to post the Where clause of your query SQL.
Copy and Paste.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Open your query in design view.
Click on View + SQL View
If your SQL is only a few lines, select the entire SQL and Copy it.
If the SQL is long, find the line (near the end) that begins
Where ....
Highlight everything after that (including the Where).
Copy it.
Then paste it into a reply to this message.

The Query SQL you posted here is asking for records for certain
cities, i.e. "Leeds", "Hull" ... etc.... "London". There is no other
criteria being called for.
It looks OK.
If the value in the [Suggested Training Venue] field is one of those
cities, that record should be returned in the query .... UNLESS the
actual datatype of the [Suggested Training Venue] field is not Text
but Number, i.e. the field is a number datatype, and a combo box is
used to select the city on your Form but the bound column of the
combo box is a Number Prime Key value.
So, you will see "Leeds" but the actual value stored in the table is
the Prime Key field value (a number), i.e. 12.

In this case either change each value in the Where clause to it's
Prime Key value equivalent:
WHERE ((([Bookings Sheet].[Suggested Training Venue])=12 Or
([Bookings Sheet].[Suggested Training Venue])= 18 Or ... etc.

Or...
include the City table in the query. Make sure the relationships are
correct, and use that City table in the where clause instead of
[Booking Sheet].
 
H

HeatherG

All sorted now. Thanks for all your help!
SELECT [Bookings Sheet].[Children's Centre Name], [Bookings
Sheet].[Local Authority], [Bookings Sheet].[Suggested Training Venue]
FROM [Bookings Sheet]
WHERE ((([Bookings Sheet].[Suggested Training Venue])="Leeds" Or
([Bookings Sheet].[Suggested Training Venue])="Hull" Or ([Bookings
Sheet].[Suggested Training Venue])="Liverpool" Or ([Bookings
Sheet].[Suggested Training Venue])="Coventry" Or ([Bookings
Sheet].[Suggested Training Venue])="Nottingham" Or ([Bookings
Sheet].[Suggested Training Venue])="Newcastle" Or ([Bookings
Sheet].[Suggested Training Venue])="Winchester" Or ([Bookings
Sheet].[Suggested Training Venue])="London"));

Hope that's right - thanks for your help so far!
On 1 Jun 2006 06:07:17 -0700, HeatherG wrote:

Not sure what you mean. Can you explain please? Thanks (and sorry for
being dim)
fredg wrote:
On 31 May 2006 04:56:25 -0700, HeatherG wrote:

I've jsut built a new database and I need to split the information on
it into 2 sections - pre-christmas and post-christmas. On the database
I have a field that contains information about the venue delegates will
be invited to which contains the city, venue name, date and times they
will be attending. I've tried to run a query with the criteria
"Leeds"Or"Hull" etc etc but it doesn't give me any results. Can anyone
tell me what I'm doing wrong, or if it is a glitch in the
ever-so-wonderful world of Microsoft. Thanks....

You'll have to post the Where clause of your query SQL.
Copy and Paste.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Open your query in design view.
Click on View + SQL View
If your SQL is only a few lines, select the entire SQL and Copy it.
If the SQL is long, find the line (near the end) that begins
Where ....
Highlight everything after that (including the Where).
Copy it.
Then paste it into a reply to this message.

The Query SQL you posted here is asking for records for certain
cities, i.e. "Leeds", "Hull" ... etc.... "London". There is no other
criteria being called for.
It looks OK.
If the value in the [Suggested Training Venue] field is one of those
cities, that record should be returned in the query .... UNLESS the
actual datatype of the [Suggested Training Venue] field is not Text
but Number, i.e. the field is a number datatype, and a combo box is
used to select the city on your Form but the bound column of the
combo box is a Number Prime Key value.
So, you will see "Leeds" but the actual value stored in the table is
the Prime Key field value (a number), i.e. 12.

In this case either change each value in the Where clause to it's
Prime Key value equivalent:
WHERE ((([Bookings Sheet].[Suggested Training Venue])=12 Or
([Bookings Sheet].[Suggested Training Venue])= 18 Or ... etc.

Or...
include the City table in the query. Make sure the relationships are
correct, and use that City table in the where clause instead of
[Booking Sheet].
 

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