I have a small problem when to do a sum by a date.
Here is my code.
Dim cmd As New SqlCommand("select sum(T_paiement.montant_paye) as montant from T_paiement where [date_peiement]= ('" & date_jour.value & "')", con)
dr = cmd.ExecuteReader
If dr.Read = True Then
On Error Resume Next
TextBox1.Text = dr(0)
End If.
I see it the following error
" Conversion from type 'DBNull' to type 'String' is not valid"
(date_peiement) is smalldatetime.
Here is my code.
Dim cmd As New SqlCommand("select sum(T_paiement.montant_paye) as montant from T_paiement where [date_peiement]= ('" & date_jour.value & "')", con)
dr = cmd.ExecuteReader
If dr.Read = True Then
On Error Resume Next
TextBox1.Text = dr(0)
End If.
I see it the following error
" Conversion from type 'DBNull' to type 'String' is not valid"
(date_peiement) is smalldatetime.