<p>I need to select from a table and filter on dates greater than a 
specified date. </p>

<p>The problem I'm having is that the dates are stored as nchar(20) and I 
can't seem to get it converted to date in the where clause. </p>

<pre><code>SELECT CONVERT(DATETIME,log_time,20) from dbo.logs 
where CONVERT(DATETIME,log_time,20) &gt; '10/20/2008' 
</code></pre>

<p>Msg 241, Level 16, State 1, Line 1 
Conversion failed when converting datetime from character string. </p>

try this:
```
```
select convert(datetime, cast(trim(log_time), nvarchar)) from dbo.logs
where convert(datetime, cast(trim(log_time), nvarchar)) > '10/20/2008'
```
```
I think the trick is that you need to trim the string and cast to nvarchar