Results 1 to 4 of 4
  1. #1
    deso is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2013
    Location
    brisbane, australia
    Posts
    23

    using LIKE


    Hi, I'm have a database of (thousands) of groundwater bores. I'm trying to figure out which ones go into the alluvium, as opposed to other geological formation. The problem is there are different names for alluvium based on the creek/river name. E.g. Big Creek Alluvium, Small Creek Alluvium, Blue River Alluvium. I want to know all records that have the word "alluvium" in the GEO field. I've got as far as the SQL below, but it's not working (asking me to enter parameter value).

    SELECT GEO_LITHO_BORES.RN
    FROM GEO_LITHO_BORES
    WHERE (((GEO_LITHO_BORES.GEO) Like "*" & [ALLUVIUM] & "*"));

    Any ideas what's wrong with my SQL?
    "GEO_LITHO_BORES" is the table name. "RN" is the records identifyer. I want the result to be a list of RNs that have the word "alluvium" in the GEO field.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Try
    ......
    Like "*" & ALLUVIUM & "*" ..........
    or
    ......
    Like "*ALLUVIUM*" ..........

    Thanks

  3. #3
    deso is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2013
    Location
    brisbane, australia
    Posts
    23
    Thanks. "*ALLUVIUM*" worked, the other one didn't.

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad you got things working.
    Actually, in the 1st option that I suggested:
    Like "*" & ALLUVIUM & "*" ..........
    I missed out typing the quotes around ALLUVIUM.
    Like "*" & "ALLUVIUM" & "*" ..........

    Thanks

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums