Incorrect syntax near the keyword 'is' in SQL server vb6
Try this:

SELECT COALESCE(MAX(bill_bno) + 1, 1) AS bill_bno
FROM   rec_all
WHERE  rw = 0
       AND 
       (CASE WHEN MONTH(bill_date) &gt;= 1 AND MONTH(bill_date) &lt;= 3
             THEN (YEAR(bill_date) - 1)
             ELSE YEAR(bill_date) END)
       =
       (CASE WHEN MONTH(Date) &gt;= 1 AND MONTH(Date) &lt;= 3
             THEN (YEAR(Date) - 1)
             ELSE YEAR(Date) END)


or this one:

SELECT COALESCE(MAX(bill_bno) + 1, 1) AS bill_bno
FROM   rec_all
WHERE  rw = 0
       AND 
       (
       (MONTH(bill_date) &gt;= 1 AND MONTH(bill_date) &lt;= 3 AND (YEAR(bill_date) - 1) = (YEAR(Date) - 1))
       OR
       ((MONTH(bill_date) &lt;&gt; 1 OR MONTH(bill_date) &lt;&gt; 3) AND (YEAR(bill_date)) = (YEAR(Date)))
       )