MySQL Forums
Forum List  »  Newbie

convert datetime to date
Posted by: Chris Serencsa
Date: August 24, 2004 10:29AM

Need to grab just the date from the datetime in MySQL. Have done this in MSSQL:

----------------------------------------------------------------------------------
Select convert(varchar,convert(varchar,start_time,101)) as [date], video_name, username
from log
where company_id = 'c.company_id'
AND (end_time - start_time) > '00:03:000'
group by convert(varchar,convert(varchar,start_time,101)), video_name, username
order by convert(varchar,convert(varchar,start_time,101)), video_name, username

example:

Start Time Video Name User
------------ -------------- -----
8/24/2004 tVideoName bob

----------------------------------------------------------------------------------
The convert function is giving me problems in MySQL when I attempt to use this:

----------------------------------------------------------------------------------
replace(convert((VARCHAR,start_time,3),'/','/')
----------------------------------------------------------------------------------

I'm doing something wrong, can some please help.

Thanks,

Chris

Options: ReplyQuote


Subject
Written By
Posted
convert datetime to date
August 24, 2004 10:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.