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"; Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.