...

View Full Version : Wildcard in Access DB



jtrechter
11-15-2006, 07:54 PM
Can somebody tell me what's wrong with my query?

SELECT main_table.FirstName
FROM main_table
WHERE main_table.FirstName= "%ann%";

I have the following firstnames: Jacqui-ann, Anna, Anne, James, and Sarah.
I'm supposed to get back the first three names, correct? I'm doing this in MS Access and my results are zero. I don't see anything wrong with my query and I've used the design view and the help guides, but still no results. Is it different in Access or something? I'm not getting errors though. Thanks.

ess
11-16-2006, 01:13 AM
It has been a while since I used MS Access...so...not sure if this would work or not....


SELECT main_table.FirstName
FROM main_table
WHERE (((main_table.FirstName) Like "*nn*"));

good luck.
Ess

vinyl-junkie
11-16-2006, 03:41 AM
This should work:


SELECT main_table.FirstName
FROM main_table
WHERE main_table.FirstName Like '%nn%'



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum