Hi,
I am trying to programmatically update a datetime field in a dataset with the current date and time (this line occurs within a for...next loop, with intLoop being the counter):
If the field already has a date in it, it works no problem. If, however, the field does not yet have a recorded value and is therefore null (which it often is) I get error number 13: Operator is not valid for type DBNull and type Date.
The datatable ("Queries") is populated from a table in a SQL Server 2000 database. The column in question ("DateResolved")is a DateTime field which is set to allow null values. It is used to record the date when an enquiry has been resolved and should not contain a date until this happens (I dont want to put a default date in to get around the problem).
Can anyone help?
Nickels
I am trying to programmatically update a datetime field in a dataset with the current date and time (this line occurs within a for...next loop, with intLoop being the counter):
Code:
dsResults.Tables("Queries").Rows(intLoop).Item("DateResolved") = Now()
The datatable ("Queries") is populated from a table in a SQL Server 2000 database. The column in question ("DateResolved")is a DateTime field which is set to allow null values. It is used to record the date when an enquiry has been resolved and should not contain a date until this happens (I dont want to put a default date in to get around the problem).
Can anyone help?
Nickels
Last edited by a moderator: