zakaryahelal
Member
- Joined
- Mar 23, 2009
- Messages
- 6
- Programming Experience
- Beginner
I have querie that work fine, but I can't use text fields as
parameters.
what I need is how to link the date of sql statement to (labelDate)
but when I start debugging the project, give me this error:
Incorrect syntax near ')'.
here is my code
is there any thing wrong in code
parameters.
what I need is how to link the date of sql statement to (labelDate)
but when I start debugging the project, give me this error:
Incorrect syntax near ')'.
here is my code
VB.NET:
Dim BuySQL As String = "WITH Complete AS ( SELECT BuySell, Quantity * Price AS Value, ExecuteDateTime, MarketID FROM dbo.CompletedOrdersView GROUP BY BuySell, Quantity, Price, ExecuteDateTime, MarketID HAVING CONVERT(varchar(10), ExecuteDateTime, 101) = " & LabelDate.Text & ") SELECT SUM (Value) FROM Complete GROUP BY BuySell HAVING BuySell = -1"
Dim Buyda As New System.Data.SqlClient.SqlDataAdapter(BuySQL, conn)
Dim Buyds As New DataSet
Buyds.Clear()
Buyda.Fill(Buyds, "BuySQL")
If Buyds.Tables(0).Rows.Count > 0 Then
Me.TxtComptBuy.Text = Format(Buyds.Tables(0).Rows(0).Item(0), "n")
Else : Me.TxtComptBuy.Text = "0"
End If
is there any thing wrong in code