Recent

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

madref

  • Hero Member
  • *****
  • Posts: 1102
  • ..... 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.

Main Platform:
--------------
Mac OS X Sonoma 14.7.4
Lazarus 4.99 (rev main_4_99-1378-ga4855f6fa5) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

rvk

  • Hero Member
  • *****
  • Posts: 6715
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