>>>Hello,
>>>I am connecting to a SQL sevrver 2005 using ADO. in VFP6 prg.
>>>I need to set datetime field in a sql table back to NULL using rs.update.
>>>I tried different ways but it still does not work.
>>>I tried:
>>>rs.Fields("discharge_date").Value=.NULL.
>>>rs.Fields("discharge_date").Value=""
>>>rs.Fields("discharge_date").Value={}
>>>rs.Fields("discharge_date").Value=NULL
>>>rs.Fields("discharge_date").Value="NULL"
>>>
>>>None of above works. I am still not unable to remove the value of the datetime field....
>>>Any idea?
>>>
>>>Thanks,
>>>Kam Lee
>>>SUNY DMC
>>
>>
>>Is the discharge_date field set to allow nulls in the SQL table?
>yes, it allows NULLs
>The field initialized to NULL when the row is first inserted , then it got update to a certain valid date, and then for certain reason I need to set it back to NULL.
>I am running out of options....
I ran a search and found this answer
system.dbnull.value
which perhaps will not work in VFP.
Did you try using a variable, e.g.
ldDate = {} && date value
ldDate = null
and use ldDate variable?
If it's not broken, fix it until it is.
My Blog