Aha, I found a solution: use the InStr function.

  SELECT Table1.Title
  FROM Table1, Table2
  WHERE InStr(1,Table2.Title,Table1.Title,1) > 0

Syntax: InStr([start, ]string1, string2[, compare])
Returns the position of the 1st occurrence of one string within another

-David


------Original Message------
From: David Shadovitz <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: November 16, 2000 8:27:35 PM GMT
Subject: OT: MS Access query


I'm trying to write an MS Access query like this:

SELECT Table1.Title
FROM Table1, Table2
WHERE Table1.Title = Table2.Title

The problem is that the Title fields' values may not be exactly equal.  Table2.Title 
may have additional text in parentheses at the end.  For example:

Table1.Title = "The cow jumped over the moon"
Table2.Title = "The cow jumped over the moon (really)"

I thought of using the LIKE operator, but it appears that LIKE only works when 
comparing a field and a string, not two fields.  If I'm wrong, please tell me the 
syntax.

Any other suggestions on how to do this query?

Thanks.
-David


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
https://secure.houseoffusion.com

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to