bigdspbandj Posted January 25, 2008 Share Posted January 25, 2008 I am having trouble formating the date fielsds (date_time, or date_submitted and date_mailed). $sql = "SELECT *, max(case when job_status.status_label='Submitted' then job_status.date_time else null end) as date_submitted, max(case when job_status.status_label='Mailed' then job_status.date_time else null end) as date_mailed FROM jobs INNER JOIN job_status ON job_status.job_id = jobs.id WHERE job_status.status_label = 'Submitted' OR job_status.status_label = 'Mailed' group by jobs.id"; Link to comment https://forums.phpfreaks.com/topic/87758-solved-having-trouble-with-date_format/ Share on other sites More sharing options...
revraz Posted January 25, 2008 Share Posted January 25, 2008 What are the fields set to in the Database? Link to comment https://forums.phpfreaks.com/topic/87758-solved-having-trouble-with-date_format/#findComment-448893 Share on other sites More sharing options...
bigdspbandj Posted January 25, 2008 Author Share Posted January 25, 2008 I just wasn't using the function in the correct spot. I used it after "then" in both cases. Link to comment https://forums.phpfreaks.com/topic/87758-solved-having-trouble-with-date_format/#findComment-448898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.