title: How to compare a DATE with a TEXT string in a QUERY function in Google Sheets?
body: <p>Goal: Return a specific value from a table of data based on a query (kinda like if VLOOKUP provided the option for multiple criteria).</p>
  
  <p>Problem: The data in the source table is a value and I can't change the data source's format. When I run my QUERY function I get <code>#N/A</code>. I know it's due to the data type of the source table data because when I update the format to "plain text" the value works.</p>
  
  <p>Here is my Query: </p>
  
  <pre><code>=QUERY(SessionsData,"select D where B='"&amp;TEXT(Date(YEAR(TODAY()),4,$A143),"yyyy-MM-dd")&amp;"' limit 1",0)
  </code></pre>
  
  <p>I know the logic works, watch <a href="https://docs.google.com/a/argyleanalytics.net/file/d/0B5UBYi--aG5NQXF5WTE3QjZIS2c/edit" rel="nofollow">this video for a brief demo</a>.</p>
  
  <p>How can I get this comparison to return results?</p>