A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting up a query



 
 
Thread Tools Display Modes
  #1  
Old March 7th, 2006, 11:42 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Setting up a query

Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name) and have
it display all information about the record that is searched on. So far, I've
manager to build my query but it shows the entire table. Could anybody assist
me?

Many thanks

Gareth Saunders
ex BOFH
  #2  
Old March 7th, 2006, 12:12 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Setting up a query

SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]

.... or ...

SELECT * FROM SomeTable WHERE SomeField LIKE "*" & [Enter text to match] &
"*"

The text that you enter between the square brackets will be displayed as a
prompt to the user when the query is run.

Also take a look at the Sales by Year report in the Northwind sample
database that comes with Access, for a more sophisticated example that uses
a custom form to prompt the user for the parameters.

--
Brendan Reynolds
Access MVP


"Gareth Saunders" wrote in
message ...
Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name) and
have
it display all information about the record that is searched on. So far,
I've
manager to build my query but it shows the entire table. Could anybody
assist
me?

Many thanks

Gareth Saunders
ex BOFH



  #3  
Old March 8th, 2006, 12:54 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Setting up a query

Hi Brendan ... I tried your two examples below and I get them to function in
the SQL window. However when I view the output and then change to the query
grid the following is in the criteria field and produces the same output as
the SQL.

Like "*" & [Enter text to match] & "*"

Why would I need to go the SQL route?

Thanks


"Brendan Reynolds" wrote in message
...
SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]

... or ...

SELECT * FROM SomeTable WHERE SomeField LIKE "*" & [Enter text to match] &
"*"

The text that you enter between the square brackets will be displayed as a
prompt to the user when the query is run.

Also take a look at the Sales by Year report in the Northwind sample
database that comes with Access, for a more sophisticated example that
uses a custom form to prompt the user for the parameters.

--
Brendan Reynolds
Access MVP


"Gareth Saunders" wrote in
message ...
Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name) and
have
it display all information about the record that is searched on. So far,
I've
manager to build my query but it shows the entire table. Could anybody
assist
me?

Many thanks

Gareth Saunders
ex BOFH





  #4  
Old March 8th, 2006, 11:25 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Setting up a query


You don't. But I can't put the query design grid in a newsgroup post! :-)

It just takes a lot longer to describe how to do something using the design
grid than it does to post the SQL. So I usually post the SQL first. I'm
usually prepared to explain how to do it using the grid if asked, but I
think you know how to do that now?

--
Brendan Reynolds
Access MVP

"Tee See" wrote in message
...
Hi Brendan ... I tried your two examples below and I get them to function
in the SQL window. However when I view the output and then change to the
query grid the following is in the criteria field and produces the same
output as the SQL.

Like "*" & [Enter text to match] & "*"

Why would I need to go the SQL route?

Thanks


"Brendan Reynolds" wrote in message
...
SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]

... or ...

SELECT * FROM SomeTable WHERE SomeField LIKE "*" & [Enter text to match]
& "*"

The text that you enter between the square brackets will be displayed as
a prompt to the user when the query is run.

Also take a look at the Sales by Year report in the Northwind sample
database that comes with Access, for a more sophisticated example that
uses a custom form to prompt the user for the parameters.

--
Brendan Reynolds
Access MVP


"Gareth Saunders" wrote in
message ...
Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name) and
have
it display all information about the record that is searched on. So far,
I've
manager to build my query but it shows the entire table. Could anybody
assist
me?

Many thanks

Gareth Saunders
ex BOFH







  #5  
Old March 10th, 2006, 12:09 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Setting up a query

Thank you. I just thought there might be something I was missing.

Regards
"Brendan Reynolds" wrote in message
...

You don't. But I can't put the query design grid in a newsgroup post! :-)

It just takes a lot longer to describe how to do something using the
design grid than it does to post the SQL. So I usually post the SQL first.
I'm usually prepared to explain how to do it using the grid if asked, but
I think you know how to do that now?

--
Brendan Reynolds
Access MVP

"Tee See" wrote in message
...
Hi Brendan ... I tried your two examples below and I get them to function
in the SQL window. However when I view the output and then change to the
query grid the following is in the criteria field and produces the same
output as the SQL.

Like "*" & [Enter text to match] & "*"

Why would I need to go the SQL route?

Thanks


"Brendan Reynolds" wrote in message
...
SELECT * FROM SomeTable WHERE SomeField = [Enter text to match]

... or ...

SELECT * FROM SomeTable WHERE SomeField LIKE "*" & [Enter text to match]
& "*"

The text that you enter between the square brackets will be displayed as
a prompt to the user when the query is run.

Also take a look at the Sales by Year report in the Northwind sample
database that comes with Access, for a more sophisticated example that
uses a custom form to prompt the user for the parameters.

--
Brendan Reynolds
Access MVP


"Gareth Saunders" wrote in
message ...
Hi there

I know this is a basic question, but I'm trying to design a query in a
database so that I can enter one field (for example a music cd name)
and have
it display all information about the record that is searched on. So
far, I've
manager to build my query but it shows the entire table. Could anybody
assist
me?

Many thanks

Gareth Saunders
ex BOFH








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross tab query construction with Subqueries Steven Cheng Running & Setting Up Queries 7 February 13th, 2006 06:52 PM
Access shuts down, when i try to save this query Dann Running & Setting Up Queries 12 February 3rd, 2006 02:49 AM
Advanced SQL Query Wes Henry General Discussion 3 December 14th, 2005 09:55 PM
AHHHH-Get Data from Multiple Excel workbooks JAA149 General Discussion 5 October 30th, 2005 05:19 PM
Office 2003 installation problem, log file attached.... Ryan Setup, Installing & Configuration 0 January 20th, 2005 06:57 PM


All times are GMT +1. The time now is 02:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.