in reply to SQL Server CAST problem using CASE with DBD::ODBC

Well, the SQL solution would be to do whatever needs to be done to satisfy the SQL on the other side. (What you're getting is an SQL error, not a Perl one, after all).

The Perl solution would be to get rid of the cast, and simply test date_completed in Perl:

$sth=$dbh->prepare(select ....); $sth->execute; $res=$sth->fetchrow_hashref; $$res{is_complete}=defined($$res_{date_completed});