Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    What is the difference between Like and ALike?

    and why does Access insist on changing the Like in the row source of a list box to ALike when Like works but ALike doesn't?

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    As far as I know ALIKE is ANSI SQL 92 or some such.

    Is the database in Compatibility mode with ANSI SQL

    Tools > Options > Tables/Queries > SQL Server Compatible Syntax (ANSI 92) Tick Box
    Or equivalent place on Access Options in 2007 and 2010
    In 2007/2010 that is in the Access Options under Object Designers

    If it is Access Converts Access standard Like to ANSI SQL ALike

    But ALIKE only works with % as the wild card

    So Like "Bi*" is equivalent to ALIKE 'Bi%'

    Note for some reason Access changes the Like to Alike but not the * to %
    So much for Compatibility there then.
    Andrew

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    Enlightening, thanks Andrew.

    There was something else going on as well. Some kind of corruption with the form.

    The where clause wasn't seeing the filter control.

    Created a new form, kept the Like and all is now well.

Posting Permissions

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