lundi 9 novembre 2015

How to populate a DateTimePicker by a "Date" Data from Database?

I use this code:

DateTimePicker1.Date := SQLQuery1.FieldByName('birthday').Value;

But it gives me an error message:

Could not convert variant of type (UnicodeString) into type (Double).

I also tried this code:

DateTimePicker1.Date := VarToDateTime(SQLQuery1.FieldByName('birthday').Value);

Unfortunately it gives me an error message:

Could not convert variant of type (UnicodeString) into type (Date)

Note: I'm using an SQLite Database. The data type of the field "birthday" is DATE.

Thanks in advanced!

Aucun commentaire:

Enregistrer un commentaire