Insert only date into MS access database using FireDac

I have a table named Students

, this table has a column date

named BirthDay

with a format Date, abbreviated

(eg: 26/06/2017), the problem is delphi Field

type SQLTimeStamp

and I want to keep only date

not a DateTime

.

DM.TStudentsBirthDay.Value := DateTimeToSQLTimeStamp(DateTimePicker1.Date);

      

A message will be posted DateTime

.

How can I fix this? How can I only insert a date?

Update:

I am trying to do this with a component TFDQuery

and it works great, also with a component TAODTable

.

+3


source to share


1 answer


Thanks for @Gerry Coll for comment .

Usage DateTimeToSQLTimeStamp()

and DateOf()

function:



DM.TStudentsBirthDay.Value := DateTimeToSQLTimeStamp(DateOf(DateTimePicker1.Date));

      

This works great.

+2


source







All Articles