the code runs fine in SQL but give error in VB.Net - My DB is MS Access sql = "SELECT sr.itemcode, sr.itemname, SUM(CASE WHEN sr.transdate='4/14/2016' THEN sr.temunits] END) AS [Units Sold], " & _ "SUM(sr.itemunits) AS [Total Units Sold] " & _ "FROM [tblINV_SalesRecord] AS sr WHERE sr.transdate <= '4/14/2016' GROUP BY sr.itemcode, sr.itemname" The error is: IErrorInfo.GetDescription Failed with E_FAIL(0x80004005), -System.Data Please how do I resolve this Thanks