You are here: Scripting Reference > Classes > Field > Field.AsDateTime

Field.AsDateTime

Declaration

property AsDateTime: string;

Example

procedure OnMapEvent(var Value:Variant);

begin

Value := Dataset['myfield'].AsDateTime; //the value of myfield is returned as a Date Time

end;

Description

Returns the value of the Field object as a See "Datetime (TDateTime)". If the field is null then the default date of 12/30/1899 12:00 am.

It is recommended that you use this property when referencing Datetime type fields. This will help you avoid issues with null values causing See "Datetime" and See "Formatting" functions to fail.