I have a datetime field in a table in Sql Server which is stores a date
(the field is nullable). I am able to store a date or set it to null
using a TIMESTAMP_STRUCT and the RFX_Date function provided by MFC
(using CRecordset object). However, once I store a date (e.g. 10/2/97)
in the field, I am unable to set it to null on subsequent edit
operations. I get a "invalid time" error from Sql Server. I am able to
edit and change the date, however I cannot set it to null (once a date
has been set).
I set the TIMESTAMP_STRUCT as following to set it to null:
TIMESTAMP_STRUCT m_tsDateTime;
m_tsDateTime.year = 99;
m_tsDateTime.month = 99;
m_tsDateTime.day = 99;
m_tsDateTime.hour = 99;
m_tsDateTime.minute = 99;
m_tsDateTime.second = 99;
m_tsDateTime.fraction = 99;
The above will set a datetime to null as long as the datetime field
does not have a date.
Any help will be appreciated.
Thanks
Gagan.
It works!!!
Thanks.
Gagan