dinoslikeroar Posted July 27, 2016 Share Posted July 27, 2016 I'm getting the following error 'Because Column 'modified_date' in where clause is ambiguous' when trying to run a report with a MySQL script it in. PHP Fatal error: Uncaught exception 'Exception' with message 'Error on query SELECT DISTINCT order_or_item_number as item_number, location, search_type FROM order_history LEFT JOIN research_queue on order_or_item_number = item_number WHERE (modified_date BETWEEN '2016-07-26 00:00:00' AND '2016-07-26 23:59:59') AND action LIKE '%SENT TO REVIEW' Because: Column 'modified_date' in where clause is ambiguous from file /home/samplereport.php test_sql = "SELECT DISTINCT order_or_item_number as item_number, location, search_type ". "FROM order_history ". "LEFT JOIN research_queue on order_or_item_number = item_number ". "WHERE (modified_date BETWEEN ??? AND ???) ". "AND action LIKE '%SENT TO REVIEW'"; I'm not sure what other information is needed. Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted July 27, 2016 Solution Share Posted July 27, 2016 Sounds like you you have "modified_date" column in both tables. You have to specify which one to use order_history.modified_date or research_queue.modified_date Quote Link to comment Share on other sites More sharing options...
dinoslikeroar Posted July 27, 2016 Author Share Posted July 27, 2016 Sounds like you you have "modified_date" column in both tables. You have to specify which one to use order_history.modified_date or research_queue.modified_date Thanks, that fixed the issue. 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.