Hi
The purpose of my system is to calculate the number of motors (stored in a microsoft access table) that is being sent for repair according to the months. This information will then have to be displayed in a form developed in vb2008.
Below are the coding used:
Public Class FormReportMonth lyOverhaul
Dim connstr As String = "Provider= \..\Database.md b"
Dim rowIndex As Integer = 0
Private Sub FormReportMonth lyOverhaul2_Loa d(..) Handles Me.Load
Dim sqlJan As String = "SELECT * FROM MotorTable WHERE Start_Date >'" & Format$(2009 / 12 / 31, "dd mm yyyy") & "'AND Start_Date < '" & Format$(2010 / 2 / 1, "dd mm yyyy") & "'"
Dim countJan As Integer
Dim dtJan As New DataTable
Dim daJan As New OleDb.OleDbData Adapter(sqlJan, connstr)
daJan.Fill(dtJa n)
daJan.Dispose()
daJan.Update(dt Jan)
countJan = CInt(dtJan.Rows .Count)
lblJan.Text = countJan
End Sub
End Class
The Start_Date column in the MotorTable db is of 'Text' format. I have a feeling that the there's something wrong with the sql. That is why it returns 0 value.
However, i just don't know how to get it done..Really appreciate a helping hand..Thank you in advance!
The purpose of my system is to calculate the number of motors (stored in a microsoft access table) that is being sent for repair according to the months. This information will then have to be displayed in a form developed in vb2008.
Below are the coding used:
Public Class FormReportMonth lyOverhaul
Dim connstr As String = "Provider= \..\Database.md b"
Dim rowIndex As Integer = 0
Private Sub FormReportMonth lyOverhaul2_Loa d(..) Handles Me.Load
Dim sqlJan As String = "SELECT * FROM MotorTable WHERE Start_Date >'" & Format$(2009 / 12 / 31, "dd mm yyyy") & "'AND Start_Date < '" & Format$(2010 / 2 / 1, "dd mm yyyy") & "'"
Dim countJan As Integer
Dim dtJan As New DataTable
Dim daJan As New OleDb.OleDbData Adapter(sqlJan, connstr)
daJan.Fill(dtJa n)
daJan.Dispose()
daJan.Update(dt Jan)
countJan = CInt(dtJan.Rows .Count)
lblJan.Text = countJan
End Sub
End Class
The Start_Date column in the MotorTable db is of 'Text' format. I have a feeling that the there's something wrong with the sql. That is why it returns 0 value.
However, i just don't know how to get it done..Really appreciate a helping hand..Thank you in advance!
Comment