title: How Can I Extract a Substring in WHERE Clause of <CFQUERY>?
body: <p>Is it possible to extract a substring in the WHERE clause in ColdFusion of either  or in a Query of Queries?  As an example, I am trying to use the following query to find all email addresses with the domain "comcast.net" (i.e. everything after the "@" in the email address).  I am querying an MS-Access database table.</p>
  
  <pre><code>&lt;cfquery name="test" datasource="membership"&gt;
        SELECT email_address
        FROM tblMembers
        WHERE MID(email_address, INSTR(email_address, '@') + 1) = 'comcast.net'
  &lt;/cfquery&gt;
  </code></pre>
  
  <p>If I attempt this as a query, I get the error message "[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression."</p>
  
  <p>If I attempt it as a Query of Queries, I get the error message 'Encountered "MID ( email1 ,. Incorrect conditional expression, Expected one of [like|null|between|in|comparison] condition,'.</p>
  
  <p>I would be very grateful for any help on finding something that works!  Thanks for your help!</p>