STUCK! Query to return data with a specific alphabetical letter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am trying to create a query in Access to return data with a specific
alphabetical letter that a user chooses.

I already have a query set up to retrieve data for companies in a certain
AREA where a pop up appears for the user to enter the area before the listing
appears ie if the user enters LONDON it will retrieve all companies in the
london area.

I need to create a query whereby if the user enters for instance the letter
A, then it will retrieve all companies starting with the letter A.

Any help on this would be much appreciated....
Thanks.
 
Hello....
This is the query (in SQL View) for the user to enter the town name in a
popup box to retrieve ALL companies within that area.

SELECT Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((Clients.Town)=[Enter Town]))
ORDER BY Clients.Town;


I need to be able to retrieve clients by CompanyName, with the user to
select A, or B or T etc, to retrieve companies that begin with that letter....

Any help would be terrific.
 
Try this. I think, but it is worth testing, that this will allow the user to
enter "b" or "B" for it to bring back Bob's Company

Select Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((UCase(Left([CompanyName],1)))=UCase([Enter Beginning Letter])));


Kerry said:
Hello....
This is the query (in SQL View) for the user to enter the town name in a
popup box to retrieve ALL companies within that area.

SELECT Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((Clients.Town)=[Enter Town]))
ORDER BY Clients.Town;


I need to be able to retrieve clients by CompanyName, with the user to
select A, or B or T etc, to retrieve companies that begin with that letter....

Any help would be terrific.

Ken Snell said:
Post the SQL statement of your current query.
 
Thank you very much!!! That worked!!

Whitless said:
Try this. I think, but it is worth testing, that this will allow the user to
enter "b" or "B" for it to bring back Bob's Company

Select Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((UCase(Left([CompanyName],1)))=UCase([Enter Beginning Letter])));


Kerry said:
Hello....
This is the query (in SQL View) for the user to enter the town name in a
popup box to retrieve ALL companies within that area.

SELECT Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((Clients.Town)=[Enter Town]))
ORDER BY Clients.Town;


I need to be able to retrieve clients by CompanyName, with the user to
select A, or B or T etc, to retrieve companies that begin with that letter....

Any help would be terrific.

Ken Snell said:
Post the SQL statement of your current query.

--

Ken Snell
<MS ACCESS MVP>

Hi,
I am trying to create a query in Access to return data with a specific
alphabetical letter that a user chooses.

I already have a query set up to retrieve data for companies in a certain
AREA where a pop up appears for the user to enter the area before the
listing
appears ie if the user enters LONDON it will retrieve all companies in the
london area.

I need to create a query whereby if the user enters for instance the
letter
A, then it will retrieve all companies starting with the letter A.

Any help on this would be much appreciated....
Thanks.
 
Check out the Like operator in the Help file. It's used to do wildcard
searches such as you want here:

SELECT Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((Clients.Town) Like [Enter Town] & "*"))
ORDER BY Clients.Town;


--

Ken Snell
<MS ACCESS MVP>

Kerry said:
Hello....
This is the query (in SQL View) for the user to enter the town name in a
popup box to retrieve ALL companies within that area.

SELECT Clients.CompanyRef, Clients.CompanyName, Clients.Address,
Clients.Town, Clients.County, Clients.Postcode
FROM Clients
WHERE (((Clients.Town)=[Enter Town]))
ORDER BY Clients.Town;


I need to be able to retrieve clients by CompanyName, with the user to
select A, or B or T etc, to retrieve companies that begin with that
letter....

Any help would be terrific.

Ken Snell said:
Post the SQL statement of your current query.
 
Back
Top