DatabaseField.DateValue
From Xojo Documentation
This item was deprecated in version 2019r2. Please use DatabaseColumn.DateTimeValue as a replacement. |
Property (As Date )
aDatabaseField.DateValue = newDateValue
or
DateValue = aDatabaseField.DateValue
Supported for all project types and targets.
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
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
Dim invoiceDate As Date
invoiceDate = rs.Field("InvoiceDate").DateValue
Set the date value of a column in a RecordSet: