Hi,
I have a mistake while creating the database field earlier.
I have DATE and TIME fields in my MYSQL Database. Now I want to convert it into DATETIME format, because I need to do querying the data based from the date and specific hours.
I dont know how to join between DATE & TIME field into new field with DATETIME format,
if i do joining in Ms Excel with concatenate function, will it work ?
Just learn about TIMESTAP if you haven’t used it before:
[quote]The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of ‘1970-01-01 00:00:01’ UTC to ‘2038-01-19 03:14:07’ UTC.
MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME.) By default, the current time zone for each connection is the server’s time.[/quote]
TIMESTAMP datatype has this small range limitation, BUT, the TIMESTAMP() function does not.
How do I know? I tested it. Check: SELECT TIMESTAMP(‘2099-01-01’), it works.
So, an: UPDATE datetimetest set dateandtime = TIMESTAMP(`date`, `time`);