MySql Time field

If you have a database field that is a TIME type (MySQL), should you use the DATE variable type in Xojo to store it?

The database has a separate field for a date (no problem) and a separate field for time. I didn’t know the best way to collect the two fields so I can combine them into a single date variable in Xojo.

Thanks!

Mysql offers datetime for that.
If you need that in two different columns, try:

select concat(datecolumn, ’ ', timecloumn) AS mydatetime from…

also:

select timstamp(dateclumn, timecolumn) as mydatetime

rs.field(“mydatetime”).datevalue should give you that xojo datevalue with date and time

In Xojo you could do:

Dim mydate as date = rs.field(“date”).datevalue
mydate.totalseconds = date.totalseconds + rs.field(“time”).datevalue.totalseconds