DatabaseField.DateValue

From Xojo Documentation

Property (As Date )
aDatabaseField.DateValue = newDateValue
or
DateValue = aDatabaseField.DateValue

Supported for all project types and targets.

Used to get and set the values of Date field types.

Notes

For situations where you need to set a database column to NULL, you should use the Value property like this:

rs.Edit
rs.Field("MyDateColumn").Value = Nil // sets to NULL in the database
rs.Update

Sample Code

Get the date value of a column in a RecordSet:

// rs is a RecordSet with a date column called "InvoiceDate"
Dim invoiceDate As Date
invoiceDate = rs.Field("InvoiceDate").DateValue

Set the currency value of a column in a RecordSet:

// rs is a RecordSet with a date column called "InvoiceDate":
rs.Edit
Dim d As New Date
rs.Field("InvoiceDate").Date = d
rs.Update