title: SQL Server: datetime out of range error
body: <p>I have this query</p>
  
  <pre><code>SELECT W.NUMBER,B.NAME,Br.NAME,W.WDATE,W.REPAIRSTATUS,W.REPAIRCOST,W.REMARK
  FROM Work_Order AS W,Brands AS B,Branches AS Br
  WHERE W.BRANDID = B.ID AND W.BRANCHID = Br.ID
  AND CAST(WDATE as DATETIME)  &lt; CAST('09/18/2012' AS DATETIME)
  </code></pre>
  
  <p>and the system respond with </p>
  
  <blockquote>
    <p><em>The conversion of a char data type to a datetime data type resulted in
    an out-of-range datetime value.</em></p>
  </blockquote>
  
  <p>also using this query it gives the same error</p>
  
  <pre><code>SELECT W.NUMBER,B.NAME,Br.NAME,W.WDATE,W.REPAIRSTATUS,W.REPAIRCOST,W.REMARK
  FROM Work_Order AS W,Brands AS B,Branches AS Br
  WHERE W.BRANDID = B.ID AND W.BRANCHID = Br.ID
  ORDER BY CAST(W.WDATE AS DATETIME)
  </code></pre>
  
  <p>WDATE is like '09/03/2012' and it is an input from jquery ui datepicker with mm/dd/yyyy date format</p>
  
  <p>Please help me I don't know how to fix it.</p>
  
  <p>I am working on SQL Server 2005.</p>
  
  <p>EDIT: I tried the same queries with another sql server 2005 and it's working fine so please how to fix this error with a sql server settings ??</p>