Posted By

troynt on 02/28/09


Tagged

DateTime


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

dantreacy
virendrakryadav


Convert Date Field and Time field to DateTime


 / Published in: MySQL
 

  1. SELECT
  2. evTitle as 'name',
  3. CONCAT(description,"\n",url) as description,
  4. CASt(CONCAT(CAST(startDate as CHAR),' ',cast(startTime as CHAR)) as DATETIME) as dtstart,
  5. CASt(CONCAT(CAST(endDate as CHAR),' ',cast(endTime as CHAR)) as DATETIME) as dtend,
  6. evVenue as location,
  7. evAddress as street,
  8. evCity as city,
  9. evState as state,
  10. cast(NOW() as DATETIME) as modified_at,
  11. cast(dateEntered as DATETIME ) as created_at,
  12. '1' as author,
  13. '127.0.0.1' as author_ip
  14. FROM FTDevents;

Report this snippet  

You need to login to post a comment.