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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Pervasive Btrieve Date Data Type to Date

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I am working with Epicor financials and all dates are stored in Pervasive Btrieve Date Data type, which is a 6 digit number. When I use the functions in Crystal, the days and months work, but not the year. How do I convert this number field into a date??
 
Try posting the actual format rather than a description.

I'll guess that it has YYMMDD, so try:

stringvar MyYear:=mid(totext({table.field},0,""),1,2);
stringvar MyMonth:=mid(totext({table.field},0,""),3,2);
stringvar MyDay:=mid(totext({table.field},0,""),5,2);
If val(Year)> 50 then
cdate(1990+val(year),val(month),val(MyDay))
else
cdate(2000+val(year),val(month),val(MyDay))

If you don't know what a field contains, right click it and select Browse Data, it will show you the data type and it's format.

-k
 
The field is a 6 digit, numeric data type(ex. 730165), which I believe is Julian. Any ideas??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top