james,
I would start by using the routine to convert the date into the days # (from
the earlier post).
Then I would compare those values to the ones you list.
Unfortunately I don't see anything that is even close, in the bytes you
give.
Which means that my routine may be "off"... (the Base Date or Base Days
constants).
Looking at the numbers you give:
02/10/1998 --82 98 10
04/21/1998 -- 82 98 80
There are 70 days between these two dates, there is a difference of 70
between the 3rd byte, this would suggest the 3rd is the least significant
digit. I would then expect the first byte to be the most significant digit
(by examining the entire column).
04/21/1998 -- 82 98 80
04/22/1999 --82 98 81
Unfortunately these two are not a day apart, instead they are a year apart!
Meaning:
01/08/1999 -- 83 01 73 days = 830173
03/09/1999 --83 02 02 days = 830202
02/10/1998 --82 98 10 days = 839110
04/21/1998 -- 82 98 80 days = 829880
03/19/1999 --83 02 12 days = 830212
04/22/1999 --82 98 81 days = 829881
11/19/1997 --82 97 27
days = 829727
Things still don't line up. Given a function like:
Private Class Bucket
Public ReadOnly theDate As Date
Public ReadOnly theDays As Integer
Public Sub New(ByVal theDate As Date, ByVal theBytes As String)
Me.theDate = theDate
Me.theDays = CInt(theBytes.Replace(" ", ""))
End Sub
Public Function SubtractDays(ByVal other As Bucket) As Integer
Return theDays - other.theDays
End Function
Public Function SubtractDates(ByVal other As Bucket) As Integer
Dim ts As TimeSpan = theDate.Subtract(other.theDate)
Return CInt(ts.TotalDays)
End Function
End Class
Dim list As New ArrayList
list.Add(New Bucket(#11/19/1997#, "82 97 27"))
list.Add(New Bucket(#2/10/1998#, "82 98 10"))
list.Add(New Bucket(#4/21/1998#, "82 98 80"))
list.Add(New Bucket(#1/8/1999#, "83 01 73"))
list.Add(New Bucket(#3/9/1999#, "83 02 02"))
list.Add(New Bucket(#3/19/1999#, "83 02 12"))
list.Add(New Bucket(#4/22/1999#, "82 98 81"))
For Each bucket1 As Bucket In list
For Each bucket2 As Bucket In list
If bucket2.theDate <> bucket1.theDate Then
Dim days1 As Integer = bucket2.SubtractDates(bucket1)
Dim days2 As Integer = bucket2.SubtractDays(bucket1)
If days1 <> days2 Then
Debug.WriteLine(bucket2.theDate.ToShortDateString(),
bucket1.theDate.ToShortDateString())
Debug.Indent()
Debug.WriteLine(days1, "date diff")
Debug.WriteLine(days2, "days diff")
Debug.WriteLine(days2 - days1, "diff diff")
Debug.Unindent()
End If
End If
Next
Next
Shows a number of your this new days number are off by either a month or a
year. A couple appear to be off by 13 months...
Hopefully I've given you some ideas to go on.
Hope this helps
Jay