RE: Select names from Field data containing Hyphen



Problem solved, my bad,

Sorry for the post, but I was pulling my hair out and had searched all over
the net. It turns out, way down in my code, another temporary SQL statement
I thought I had rem'd out was still firing.

"Lhunt" wrote:

> I have an MS ACCESS 2000 database with 9000 lastnames and some are hyphenated.
>
> I want to pull 250 records for lastname "SMITH" andahigher, the first
> record it pulls is "SMITH-JAMES" (with the hyphen) then skips the other
> SMITH and goes on to SMOOT. I found double quotes work with apostrophies and
> confirmed that works, but the Hyphen does not and with some many people
> having hyphenated names it seems this is generally a problem.
>
> How can I select this. I have tried
>
> Select top 250 lastname, firstname from PNames where lastname >= '" &
> "SMITH" & "'"
> Select top 250 lastname, firstname from PNames where lastname like '" &
> "SMITH" & "*'"
> Select top 250 lastname, firstname from PNames where lastname like '" &
> "SMITH" & "%'"
>
> It totaly skips all of the Plain Smiths, returns my first record is
> SMITH-JAMES then the next one is SMOOT.
.



Relevant Pages

  • Re: George Smith. Real Man.
    ... Great that he did - even greater Smith left it on the field (the ... argument, not the dreadlock) ... Did Umaga's / So'i'alo / Howlett (when he had hair) used to get pulled ...
    (rec.sport.rugby.union)
  • Select names from Field data containing Hyphen
    ... I want to pull 250 records for lastname "SMITH" andahigher, ... SMITH and goes on to SMOOT. ... SMITH-JAMES then the next one is SMOOT. ...
    (microsoft.public.data.ado)
  • Re: Combo Box Name Selection
    ... see the thread titled "Combo box NOT giving correct information!!! ... > it only displays the first record with the name Smith in the form. ... > How can I display the record that I select? ...
    (microsoft.public.access.forms)