Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates in btrieve

Status
Not open for further replies.

wyngat

Vendor
Feb 9, 2002
3
ZA
Currently I dump data from btrieve 6.x files to asci files but I have a problem to convert the dates when I import this into MS Access 2000. A number of 729647 must equal 15/09/98. Can anybody help me please. Thanks
 
Dear Wyngate,
First off, since this forum is international in nature, I will use the IS0 8601 standard for dates which is YYYY-MM-DD format.

If you examine the magical number 729647, it is the number of days since 0001-01-01 reckoned as number 1. The storage in Btrieve you refer to is in "Integer Date" format and the date you refer to 1998-09-15 is day number 729647.

MS products also uses the integer date format with 1900-01-01 as number 1.

No Y2K or YXK problems. Neat huh.

In both storage, since dates are stored as numbers and not any ambiguous format, calculations on dates can be done. So if you have a date variable DateSale and an expression like DateSale + 15 you are actually adding 15 to a number. The end result is that your software will translate that number you refer to 729647 and show it to all and sundry translated to human understandable as 1998-09-15.

Your question how to parse a Btrieve date to Access 2000, update the MS Access field with Btrieve field less 693595.

The Gregorian calender repeats years exactly one 28 years. There seems to be a glitch in MS or Btrieve algorthyms for this. Don't have MS Access, please experiment with this first.


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top