Problems querying an accdb database

I

IT Admin

I have an accdb file with the table Accomodations

First 3 columns in the table are

Property Name: Address: City
I can see that Column under Property name contains

Cobb Ridge Recreation Area

But in access if I do a

select * from Accomodations where 'Property Name:' like 'Cobb%'

Against the database, I get no results.

WHY!!!!
 
J

John W. Vinson

I have an accdb file with the table Accomodations

First 3 columns in the table are

Property Name: Address: City
I can see that Column under Property name contains

Cobb Ridge Recreation Area

But in access if I do a

select * from Accomodations where 'Property Name:' like 'Cobb%'

Against the database, I get no results.

WHY!!!!

% is the wildcard character for SQL/Server compatibility mode... which is NOT
the default. Also delimiting your fieldnames with ' characters is incorrect
syntax for Access! The colon after Name is also suspicious.

Try

SELECT * FROM Accommodations WHERE [Property Name] LIKE "Cobb*";
 

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