title: SharePoint's CAML query the "Created By" field with username
body: <p>Hey, I have a form for administrators where they insert a user name ("domain\name") and the code gets and sets some information out of it. </p>
  
  <p>It's a huge project and some of the lists contain the username as a string ("domain\name"), but some lists only count on the "Created By" column, which is auto-created.</p>
  
  <p>I want to know what's the fastest way to query these lists using the username string. I tried to use the same query as the one I use for the first kind of lists and it obviously didn't work - </p>
  
  <pre><code>&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='UserName'/&gt;&lt;Value Type='Text'&gt;domain\\username&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;
  </code></pre>
  
  <p>Thank you.</p>