12/31/1840 is point zero for $H / $HOROLOG.
Negative values are not allowed.
You have to use Julian date before 12/31/1840
Julian date is $H+2393471
To convert Julian date you have to use $system.SQL.TODATE(...,"J")
Attention:
Values > 2393470 are converted to $H format
Values < 2393471 are converted to SQL date format YYYY-MM-DD
e.g. $system.SQL.TODATE(2374674,"J") ==> 1789-07-14
$system.SQL.TOCHAR(2393430,"J") does the opposite conversion
e.g. $system.SQL.TOCHAR("1776-07-04","J") ==> 2369916
HTH,
Robert C.Cemper
--
Senior Sales Engineer Austria
InterSystems GmbH
tel.: +43 (676) 400 80 73
http://www.InterSystems.at/
--
InterSystems GmbH
Hilpertstr. 20a
D-64295 Darmstadt
Tel.: +49.6151.1747-0
Fax: +49.6151.1747-11
Geschäftsführer: Jörg Klingler, John Macheras, Stephen G. Baron
Eingetragen beim AG Darmstadt unter HRB 4966