Subject Re: [firebird-support] Converting Base Date of DATE fields
Author Helen Borrie
At 11:44 PM 2/11/2004 +1100, you wrote:

>Hi Guys
>
>In my legacy application which has a lot of DATE fields, I store dates as a
>small integer where day 1 is January 1, 1980 and day 32767 (I don't handle
>-ve dates & the legacy language only supports signed 16 bit integers)is
>somewhere in the year 2069, which has never been a problem.
>
>When I convert my flat file db into FB is their a way I can add this short
>integer representation of a date, to a 32 bit integer representing December
>31, 1979 then presumably I can cast this to a DATE field? And if so, does
>anyone know what the integer equivalent of December 31, 1979 is or how it
>can be calculated easily.

Too easy! (Read Chapter 10)

Datefield = cast('31.12.1979' as DATE) + YourStoredNumber

./heLen