Re: Strange large numbers represents dates
- From: "Bill Bach" <goldstar@xxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 21:22:46 -0600
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@xxxxxxxxxxxxxxxxxxxx
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/27/06 ***
anthonyo@xxxxxxxxxxxxxxxxxxxxxx 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
.
- References:
- Strange large numbers represents dates
- From: anthonyo
- Strange large numbers represents dates
- Prev by Date: Re: Question about Btrieve programming
- Next by Date: variable-length data
- Previous by thread: Re: Strange large numbers represents dates
- Next by thread: variable-length data
- Index(es):