Recent

Author Topic: [SOLVED] TDBDateTimePicker reading date  (Read 2472 times)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
[SOLVED] TDBDateTimePicker reading date
« on: September 19, 2016, 12:07:14 pm »
Is there a way to read the date from the TDBDateTimePicker?


TDBDateTimePicker.Date, TDBDateTimePicker.DateTime and TDBDateTimePicker.GetDate do not work?
« Last Edit: September 20, 2016, 12:25:41 am by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: TDBDateTimePicker reading date
« Reply #1 on: September 19, 2016, 12:50:11 pm »
These properties are not available for the DB-version of TDBDateTimePicker.

You can access the Date/Time of the field directly.
DBDateTimePicker1.Field.AsDateTime


O, and since TDBDateTimePicker is a TCustomDateTimePicker you can also do this:
uses DateTimePicker;
TDateTimePicker(DBDateTimePicker1).Date
(but I would go for the field-property unless you have to do it this way)
« Last Edit: September 19, 2016, 12:55:36 pm by rvk »

 

TinyPortal © 2005-2018