Hi,
in SQL the wildcard parameter is the percent sign '%', so you should use a condition like "WHERE strLastName like 's%' ". But be aware that this comparison is case sensitive, means "Somename" won't match.
Furthermore statements like this use a lot of I/O and CPU because the SQL engine has to read and compare the value of each row. If you've got to compare to the first letter oftenly, you'd better add a separate column "FIRST_LETTER char(1)" and place an index on that.
Regards
Doc Diesel
I know in Oracle SQL the Wildcard symbol is %, but in Microsoft Access, the wild card is asterisk *... Using % in MS Access 2003 didn't work out very well... I tried:
- SELECT strLastName, dteHIreDate
-
FROM tblContractors
-
WHERE strLastName like '%sher%'
-
ORDER BY dteHireDate;
And it didn't return anything, even though I know for a fact in the strLastName column there's a value that matches that pattern, "Sherman". When I change the % symbols in the select statement to * it works fine.
I don't know what I did to it, but for some reason the query works now. <.< I've tried to reproduce the problem, but I can't. But it was asking me for a parameter value, and I just didn't know what that meant...I guess what that meant was "you typed something, somewhere in wrong" lol... >_<
Anyway thank you for your input. :)