DATE column data is stored in Sybase IQ as four bytes (a 32-bit unsigned integer) representing the number of days since 0000-01-01.
To convert a calendar date to the Sybase IQ binary format, for a given year, month, and day, use:
year = current_year - 1; days_in_year_0000 = 366; binaryDateValue = (year * 365) + (year / 4) - (year / 100) + (year / 400) + days_in_year_0000 + day_of_current_year -1;
For the day_of_current_year value in the formula above, consider the following example: February 12 is day 43.