<div><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">Hey James,</span></div><div><span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><br></span></div><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">I think the problem might be that the query builder, when you press ok, is setting the the layer subset via QgsDataProvider::<span class="Apple-style-span" style="white-space: pre; ">setSubsetString(string).  How setSubSetString works is up to the provider.  In your case the provider, that you joined to, doesn&#39;t know anything about the other fields or how to filter based on them so it just returns nothing.</span></span><div>

<span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><span class="Apple-style-span" style="white-space: pre; "><br></span></span></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><span class="Apple-style-span" style="white-space: pre;">QGIS itself doesn&#39;t have a SQL engine in it&#39;s own right all most everything with querying, except for the basic stuff, is passed to the provider.   I have had a chat to a few of the devs and it is something I am considering if and how it could be added to QGIS.  Not something that I myself will be able to do, way over my head, but more just getting the ideas out there and maybe some will fund it.</span></font></div>

<div><font class="Apple-style-span" face="tahoma, sans-serif"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><span class="Apple-style-span" style="white-space: pre;">Hopefully this will at lest let you understand what is happening.</span></font></div>

<div><font class="Apple-style-span" face="tahoma, sans-serif"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><span class="Apple-style-span" style="white-space: pre;">- Nathan<br>

</span></font><br><div class="gmail_quote">On Fri, Nov 4, 2011 at 10:01 PM, James Stott <span dir="ltr">&lt;<a href="mailto:James.Stott@npaconsult.co.uk">James.Stott@npaconsult.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<p class="MsoNormal">I have opened an Access table via an ODBC connection. This has allowed me to open the attribute table up in QGIS. I have then done a join to join my attribute and polygon data together. I can style the data using the joined fields, and they all show up in the attribute table and the identify tool. However I cannot use these fields in a query. <u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If I use the query builder the fields show in the fields list, and the values from the fields show in the field list. However all of my queries return no results.</p>

</blockquote></div><br></div>