I am brand new to MS SQL. I am trying to execute a query like below from a back-end OS using appropriate dbc..

Code:
SELECT count(*) FROM Table1  with (nolock)
WHERE 1=1
and (begindate >= date '2012-12-01'
or (closedate >= date '2012-12-01' and closedate < date '2013-12-31'));
I am getting an error as

No field number 0 in record
end


Please correct me if made any mistakes in the query. Thanks !!