Data.DB.TParam.AsDate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AsDate: TDateTime read GetAsDateTime write SetAsDate;

C++

__property System::TDateTime AsDate = {read=GetAsDateTime, write=SetAsDate};

Properties

Type Visibility Source Unit Parent
property public
Data.DB.pas
Data.DB.hpp
Data.DB TParam

Description

Specifies the value of the parameter when it represents a date field.

Set AsDate to assign the value for a date field to the parameter. Setting AsDate sets the DataType property to ftDate.

Read the AsDate property to determine the value that was assigned to an output parameter, represented as a TDateTime. The value of the parameter is converted to a DateTime value if possible. If the DataType for the parameter is ftDate, only the date portion of the TDateTime value is valid. If a TDateTime value is assigned to a parameter via the AsDate property and the TDateTime value has a nonzero time, the time is ignored and only the date is assigned. If AsDate is used to get the value for a TDateTime container, the date from the parameter is stored but the TDateTime gets a zero time value.

Note: It is not possible to store a NULL value directly to a parameter using AsDate. Use the TParam.Clear method instead.

See Also

Code Examples