Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002

    Unanswered: Finding a numeric value inside text string

    Hi folks,

    I'm having a problem with a query that should search the comma separated values in a text string and pull the matching uid's out. For example:

    SELECT Products.Name, epi_phones.mobile_mfr, epi_phones.mobile_model, Products.WorksWith
    FROM epi_phones, epi_carriers, Products
    WHERE epi_phones.uid IN (Products.WorksWith);

    This gives me a data type mismatch, presumably because epi_phones.uid is AutoNumber and Products.WorksWith is a Text(255) field. I've tried CStr(), Str() on epi_phones.uid and get nothing. If I switch it to

    SELECT epi_phones.mobile_mfr, epi_phones.mobile_model, Products.WorksWith
    FROM epi_phones, Products
    WHERE (((epi_phones.uid) Like Val([Products].[WorksWith])))

    then I get the first match, but not the second or more matches.

    Does anyone know what I need to do to get all matches in the text array?


  2. #2
    Join Date
    Oct 2003
    Unfortunately ... there's no easy way to do it given the data representation you have chosen. The "worksWith" field is a poor rep of a 1-many relationship.

    You can cast the number to a string and search for the string as a substring but it will be s-l-o-w..
    ChimneySweep(R): fast, automatic
    table repair at a click of the

Posting Permissions

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