Re: Date problem
Posted in 1997
Topics: General Discussion
Daniel Wright wrote: > > > Since I've worked on this version of EC, I'll give it my best guess. > I don't know that it matters any, but is the colum defined as date or > datetime? I am more familiar with "date", which I believed (I am 100% > sure of this in older versions of Standard Engine) is stored as the > number of days since 1900. > If you don't see anything and there's nothing wrong with your ?printf or > whatever output routine your using, then I'd guess it's a NULL value. > I'm sure you're aware of checking for NULL values with indicator > variables, but just in case: > $ SELECT the_date > INTO :f_the_date:i_f_the_date > FROM.... > if (i_f_the_date == 0)...... ^^^^^^^^^^^^^^^^^ This is not the way to check for NULLs. Zero is a valid non-NULL date (zero days since 1900). Use the risnull() function. if (risnull(SQLDATE, (char *)&i_f_the_date) ... If 'i_f_the_date' is null, the value will be the minimum negative long int (at least under IRIX 5.3).