In my datagrid my sql statement uses a have clause to get set information and i am having countless errors
My code is as shown below, were am i going wrong
`
con.Open()
cmd.Connection = con
Dim da As New SqlDataAdapter("SELECT MONTH(Head.SalesDate) AS Month, Detail.ProductID, Detail.Qty, SUM (Detail.Qty) AS TotalSold, SUM(Detail.Qty / 30) AS Average FROM Head INNER JOIN Detail ON Head.HeadID = Detail.HeadID GROUP BY MONTH(Head.SalesDate),Detail.ProductID, Detail.Qty HAVING MONTH(Head.SalesDate)= " & TextBox2.Text & "", con)
Dim dt As New DataTable
da.Fill(dt)
DataGridView1.DataSource = dt
cmd.Dispose()
End Sub`