Assign DateTime to Nullable <DateTime> in F #
I have F # code where I need to update a field in a database record. I am using Type Provider for SQL. The table has a field with a zero date value. When I try to update the value of a date field to DateTime.UtcNow, the compiler complains that "this expression should have been of type Nullable <DateTime>, but there is a DateTime type here." How to convert / distinguish from DateTime to Nullable <DateTime>.
My code currently looks something like this:
for queryItem in queryResult do queryItem.CurrentDate <- DateTime.UtcNow // This gives compiler error as described above Hello
+6