title: RavenHQ index query returning (500) Internal Server Error
body: <p>My original question can be found here:
  <a href="https://stackoverflow.com/questions/13166439/ravendb-query-on-datetime-with-value-in-collection-offset">RavenDB Index Query Question</a></p>
  
  <p>I got that working great using the following index now:</p>
  
  <pre><code>public class JobsQueuedListCurrent : AbstractIndexCreationTask&lt;AppointmentReminder, JobsQueuedListCurrent.IndexResult&gt;
  {
      public class IndexResult
      {
          public int Id { get; set; }
          public DateTime AppointmentDateTime { get; set; }
          public ReminderStatus ReminderStatus { get; set; }
          public DateTime JobDateTime { get; set; }
          public JobStatus JobStatus { get; set; }
      }
  
      public JobsQueuedListCurrent()
      {
  
  
          Map = appointmentreminders =&gt; from appointmentreminder in appointmentreminders
                                        from job in appointmentreminder.NotificationJobs
                                        where (appointmentreminder.ReminderStatus != ReminderStatus.Confirmed)
  
                                        select new 
                                        { 
                                            Id = appointmentreminder.Id, 
                                            AppointmentDateTime = appointmentreminder.AppointmentDateTime,
                                            ReminderStatus = appointmentreminder.ReminderStatus,
                                            JobDateTime = appointmentreminder.AppointmentDateTime.AddDays(job.DaysOffset),
                                            JobStatus = job.JobStatus
                                        };
  
          Store(x =&gt; x.AppointmentDateTime, FieldStorage.Yes);
          Store(x =&gt; x.ReminderStatus, FieldStorage.Yes);
          Store(x =&gt; x.JobDateTime, FieldStorage.Yes);
          Store(x =&gt; x.JobStatus, FieldStorage.Yes);
  
      }
  }
  </code></pre>
  
  <p>I moved my code from my local machine to AppHarbor and RavenHQ.  I can connect and query normal data in Appharbor and RavenHQ now.  My controller looks like:</p>
  
  <pre><code>public ActionResult GetJobsQueuedListCurrent()
      {
          var jobsqueuedlist = RavenSession.Query&lt;JobsQueuedListCurrent.IndexResult, JobsQueuedListCurrent&gt;()
              .OrderBy(x =&gt; x.AppointmentDateTime)
              .As&lt;AppointmentReminder&gt;()
              .Take(20)
              .ToList();
  
          return View("List", jobsqueuedlist);
  
      }
  </code></pre>
  
  <p>That works fine, when I add the following where clause:</p>
  
  <pre><code>.Where(x =&gt; (x.JobDateTime &lt;= DateTime.Now))
  </code></pre>
  
  <p>So that the controller looks like:</p>
  
  <pre><code>public ActionResult GetJobsQueuedListCurrent()
      {
          var jobsqueuedlist = RavenSession.Query&lt;JobsQueuedListCurrent.IndexResult, JobsQueuedListCurrent&gt;()
              .Where(x =&gt; (x.JobDateTime &lt;= DateTime.Now))
              .OrderBy(x =&gt; x.AppointmentDateTime)
              .As&lt;AppointmentReminder&gt;()
              .Take(20)
              .ToList();
  
          return View("List", jobsqueuedlist);
  
      }
  </code></pre>
  
  <p>This now results in an error (500): Internal Server Error, a link to the pastebin of the output is below:</p>
  
  <p><a href="http://pastebin.com/HXvC15jn" rel="nofollow noreferrer">Pastebin</a></p>
  
  <p>What can I do to allow the query to use datetime in the Where clause?  BTW I am using the latest unstable on my client (1.2.2139-Unstable) to talk to RavenHQ.  Thanks.</p>