I have to compare and take the different days between the date in MS Access database (DateList) versus the date in VB:
Dim Date_Out As DateTime
Dim Day_Different As Integer
strSQL = "SELECT * FROM DateList WHERE Date_In < #" & Date_Out & "# "
da = New OleDbDataAdapter(strSQL, dbConn)
dt = New DataTable
da.Fill(dt)
If dt.Rows.Count() > 0 Then
'Debug error
Day_Different = Date_Out - dt.Rows(0).Item("Date_In")
End If
*) If I take Date_Out.day and CDate(dt.Rows(0).Item("Date_In")).day ... it might produce error as Day_Out = 2011-06-01 and dt.Rows(0).Item("Date_In") = 2011-05-31 equals - 30 days instead of 1 day. That doesn't including different more than 1 month
Thank you any help
Dim Date_Out As DateTime
Dim Day_Different As Integer
strSQL = "SELECT * FROM DateList WHERE Date_In < #" & Date_Out & "# "
da = New OleDbDataAdapter(strSQL, dbConn)
dt = New DataTable
da.Fill(dt)
If dt.Rows.Count() > 0 Then
'Debug error
Day_Different = Date_Out - dt.Rows(0).Item("Date_In")
End If
*) If I take Date_Out.day and CDate(dt.Rows(0).Item("Date_In")).day ... it might produce error as Day_Out = 2011-06-01 and dt.Rows(0).Item("Date_In") = 2011-05-31 equals - 30 days instead of 1 day. That doesn't including different more than 1 month
Thank you any help