5.10 Combining a Date and a Time into a Date-and-Time Value
5.10.1 Problem
You want to
produce a combined date-and-time value from separate date
and time values.
5.10.2 Solution
Concatenate them with a space in between.
5.10.3 Discussion
Combining a date value and a time value to produce a date-and-time
value is just a matter of concatenating them with a space in between:
mysql> SET @d = '2002-02-28';
mysql> SET @t = '13:10:05';
mysql> SELECT @d, @t, CONCAT(@d,' ',@t);
+------------+----------+---------------------+
| @d | @t | CONCAT(@d,' ',@t) |
+------------+----------+---------------------+
| 2002-02-28 | 13:10:05 | 2002-02-28 13:10:05 |
+------------+----------+---------------------+
|