Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query Select Problem

Status
Not open for further replies.

datadch

Programmer
Mar 13, 2005
2
US
This seems like such a simple task but Access isnt cooperating.

I am trying to run the following query select in MS Access 2000 and am getting no results even though I know that the data in the field (client_name)is valid.

SELECT * FROM member_events WHERE member_id = 1 and client_name = "Alfred Hitchcock";

I have copied copied the data for client_name directly from the database table and pasted into the query to ensure that there are no embedded spaces or characters.

When I run this, the query returns no rows.

I'm stumped. Can anyone help.
 
What happens when you remove either the Member_ID or Client_Name parts of the query criteria? Have you tried using
Code:
Like "*Alfred*"

What were your results when trying these suggestions?


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
When I use just the member_id i get all the records that I should get. When i use *like "*Alfred*" I also get the records. But I cant use the like clause because there may be many records with that name in it. I am looking for a specific client name to match what is in the database. I am getting the parent record from the client file which also writes the same name to the file that I am trying to access.

It seems like access is having a problem matching the criteria correctly.

Could this be a problem with the way my keys are defined?

I've been programming for a very long time, and just wonder if this is an access bug.

Thanks.
 
It is difficult to reply to your question about your definition of keys if we don't know how your tables are structured.

I would consider it a mistake if you use names as primary or foreign keys. I also recommend against using lookup fields in tables.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top