Strange large numbers represents dates

  • Follow


We use a Pervasive SQL application named Isthmus. I'm trying to create
a stock movements report based on a table where the dates consist of
numbers such as 131,401,737.  Spent the whole day trying to crack the
code and failed. Where is that fellow that worked out the Rosetta stone
when you need him?

Am hoping help is at hand in this group. All the dates below in 2005.
131,401,737 is 9 August
131,401,740 is 12 August
131,401,751 is 23 August
131,401,754 is 26 August
so far so good days progress by 1
131,401,986 is 2 Sep 7 days later but 232 numbers apart.
131,402,775 is 23 Dec.

I'll give a bottle of wine to who can help?

Thanks
Anthony

0
Reply anthonyo (1) 3/13/2006 10:47:45 PM

<anthonyo@futurelogistics.com.au> wrote in message 
news:1142290065.657374.219400@e56g2000cwe.googlegroups.com...
> We use a Pervasive SQL application named Isthmus. I'm trying to create
> a stock movements report based on a table where the dates consist of
> numbers such as 131,401,737.  Spent the whole day trying to crack the
> code and failed. Where is that fellow that worked out the Rosetta stone
> when you need him?
>
> Am hoping help is at hand in this group. All the dates below in 2005.
> 131,401,737 is 9 August
> 131,401,740 is 12 August
> 131,401,751 is 23 August
> 131,401,754 is 26 August
> so far so good days progress by 1
> 131,401,986 is 2 Sep 7 days later but 232 numbers apart.
> 131,402,775 is 23 Dec.
>
> I'll give a bottle of wine to who can help?
>
> Thanks
> Anthony
>

Have just done more analysis and the days progress by 1 but a new month will 
add either 225 or 226 and between years 2005 and 2006 the difference is 
62,678.


0
Reply Anthonyo 3/13/2006 11:23:43 PM


Hello.

This is the VBasic formule :

Number  =  (day*(256^0)) + (month*(256^1)) +(year MOD 256) + 
(FIX(year/256)*(256^3))

131,401,737 = (9*(256^0)) + (8*(256^1)) +(2005 MOD 256) + 
(FIX(2005/256)*(256^3))

Good luck
David Sans


 & chr(month) & chr(
"Anthonyo" <anthonyo@futurelogistics.com.au> escribi� en el mensaje 
news:4415ff64$1@news.melbourne.pipenetworks.com...
> <anthonyo@futurelogistics.com.au> wrote in message 
> news:1142290065.657374.219400@e56g2000cwe.googlegroups.com...
>> We use a Pervasive SQL application named Isthmus. I'm trying to create
>> a stock movements report based on a table where the dates consist of
>> numbers such as 131,401,737.  Spent the whole day trying to crack the
>> code and failed. Where is that fellow that worked out the Rosetta stone
>> when you need him?
>>
>> Am hoping help is at hand in this group. All the dates below in 2005.
>> 131,401,737 is 9 August
>> 131,401,740 is 12 August
>> 131,401,751 is 23 August
>> 131,401,754 is 26 August
>> so far so good days progress by 1
>> 131,401,986 is 2 Sep 7 days later but 232 numbers apart.
>> 131,402,775 is 23 Dec.
>>
>> I'll give a bottle of wine to who can help?
>>
>> Thanks
>> Anthony
>>
>
> Have just done more analysis and the days progress by 1 but a new month 
> will add either 225 or 226 and between years 2005 and 2006 the difference 
> is 62,678.
>
> 


0
Reply David 3/14/2006 1:16:08 PM

(snip)

Raimund has found the answer. It is shown below.
"hello Anthony
"Since this is not Btrieve specific I EMail you directly.
If you look to the dates in bytes you can see the representation.
131,401,737 = 0x7D50809
0x7d5 = 2005
Hope this helps
Raimund"

Thanks everyone.




0
Reply Anthonyo 3/14/2006 11:00:03 PM

The analysis (and subsequent bottle of wine) that the previous folks
did is correct.  However, here is an easier way of addressing it,
straight from the Pervasive.SQL Software Developers Kit manual
(available online as well):

DATE 
The DATE key type is stored internally as a 4-byte value. The day and
the month are each stored in 1-byte binary format. The year is a 2-byte
binary number that represents the entire year value. The MicroKernel
places the day into the first byte, the month into the second byte, and
the year into a two-byte word following the month.
An example of C structure used for date fields would be: 
TYPE dateField { 
char day; 
char month; 
integer year; 
} 
The year portion of a date field is expected to be set to the integer
representation of the entire year. For example, 2,001 for the year 2001.
Note that when you view the resulting value in "little endian" format,
you get the values you discovered.  HTH...
	Goldstar Software Inc.
	Building on Btrieve(R) for the Future(SM)
	Bill Bach 
	BillBach@goldstarsoftware.com
	http://www.goldstarsoftware.com
	*** Chicago: Pervasive Service & Support Class - 03/27/06 ***



anthonyo@futurelogistics.com.au wrote:

> We use a Pervasive SQL application named Isthmus. I'm trying to create
> a stock movements report based on a table where the dates consist of
> numbers such as 131,401,737.  Spent the whole day trying to crack the
> code and failed. Where is that fellow that worked out the Rosetta
> stone when you need him?
> 
> Am hoping help is at hand in this group. All the dates below in 2005.
> 131,401,737 is 9 August
> 131,401,740 is 12 August
> 131,401,751 is 23 August
> 131,401,754 is 26 August
> so far so good days progress by 1
> 131,401,986 is 2 Sep 7 days later but 232 numbers apart.
> 131,402,775 is 23 Dec.
> 
> I'll give a bottle of wine to who can help?
> 
> Thanks
> Anthony

0
Reply Bill 3/15/2006 3:22:46 AM

4 Replies
239 Views

(page loaded in 0.109 seconds)

Similiar Articles:













7/25/2012 4:39:09 AM


Reply: