title: Convert datetime to a formatted string inside a LINQ-to-entities query
body: <p>How can I convert <code>DateTime</code> into a formatted string?</p>
  
  <p>This is the line in the following query that needs help:</p>
  
  <pre><code>StartDate = string.Format("{0:dd.MM.yy}", p.StartDate)
  </code></pre>
  
  <p>The whole query:</p>
  
  <pre><code>var offer = (from p in dc.CustomerOffer
               join q in dc.OffersInBranch
               on p.ID equals q.OfferID
               where q.BranchID == singleLoc.LocationID
               let value = (p.OriginalPrice - p.NewPrice) * 100 / p.OriginalPrice
               orderby value descending
               select new Offer()
               {
                   Title = p.OfferTitle,
                   Description = p.Description,
                   BestOffer = value,
                   ID = p.ID,
                   LocationID = q.BranchID,
                   LocationName = q.CustomerBranch.BranchName,
                   OriginalPrice = SqlFunctions.StringConvert((decimal)p.OriginalPrice),
                   NewPrice = SqlFunctions.StringConvert((decimal)p.NewPrice),
                   StartDate = string.Format("{0:dd.MM.yy}", p.StartDate)
               }).First();
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression.</p>
  </blockquote>