Results 1 to 8 of 8

Thread: SQL statement

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    SQL statement

    Hi,

    I think my brain is dead today.

    Select * From tblClients Where LastName LIKE 'and*'

    eof is true although I know there are clients with lastnames beginning with and.

    Why?

  2. #2
    Lively Member tom_hotspur's Avatar
    Join Date
    Aug 2002
    Location
    Stafford
    Posts
    96
    Are you using SQL Server if so i think the wild card charactor should be a %
    tom

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Access 97
    ADO 2.6

  4. #4
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Try using % not * I think it will then work.

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Have you tried if

    Select * From tblClients Where LastName LIKE '*'

    retrieves anything?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    worked for me.. im using access 2k though.. wouldn't imagine it changed though

  7. #7
    Lively Member tom_hotspur's Avatar
    Join Date
    Aug 2002
    Location
    Stafford
    Posts
    96
    Hiya
    I've just tried an old VB client ive got for a Access 97 db and
    it finds a user when i use % but fails when i use *

    go figure?
    tom

  8. #8

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Thanks guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width