Mel,
> I have recently discovered a problem with Allbase, ODBC SE and dates
> that some of you may want to watch for.
>
> We converted an Image database to Allbase and then dates ended up
> looking like this - 0095-05-30 - in a normal select statement. This
> is fine as our code looks for the missing "19". However, MS Access
> and other ODBC clients display the date as 05/30/00 or 05/30/1900.
> Identical data in MS SQL or Interbase display fine. This leads me to
> suspect the ODBC drivers. The dates work fine if they have 4 digit
> years.
<snip>
As with all SQL Dates, the string type dates used in TurboIMAGE and
Image/SQL must be converted to a Date-type. This requires the use of
Casting in Allbase or your favorite development tool.
For example, using Visual Basic, to migrate a 6-digit date:
mm$ = mid(DateField,3,2)
dd$ = mid(DateField,5,2)
yy$ = mid(DateField,1,2)
NewDateField = CDate(mm$ & "/" & dd$ & "/" & yy$)
Then INSERT or UPDATE the Date field in your Allbase Table with the
NewDateField above. YYMMDD strings do not, and will not convert directly
into SQL dates without some intervention.
It is important to note - is the use of a two-digit year within a Windows
environment and using the code above: Microsoft uses a "cutoff year" of 25
when dealing with a two-digit year. This means that "00" through "24" are
considered "2000" through "2024" --- and "25" through "99" are considered
"1925" through "1999".
Lastly, to show the 4-digit years on Windows (if using C/S apps), go to the
Control Panel, open Date/Time, and set the Date Option for a four-digit
year. The default is two-digit. If a Windows app reads a four-digit date,
it will be treated as shown. If a two-digit year is read, then the above
"25" cutoff will be placed into effect.
Best Regards,
Joe
==========================================================
Joe Geiser, Senior Partner, CSI Business Solutions, LLC
** Your Client-Server and Internetworking Specialists **
Phone: +1 (215) 945.8100 Fax: +1 (215) 943.8408
*New* Toll-Free (US/Canada): (877) 945-8100
http://www.csillc.com mailto:[log in to unmask]
==========================================================
HP Channel Partner Allaire Alliance Partner
Microsoft ClubWin - Team One
|