SELECT depreciate.id, depreciate.item_id, depreciate.batch_code,
new_item.description, depreciate.life_time, depreciate.scrap_value,
depreciate.dep_type, item.po_number, item.purchase_value,
item.current_value, item.purchase_date, depreciate.annual_depreciation,
depreciate.depreciation_rate, depreciate.total_depreciate,
depreciate.location, depreciate.dis_id
FROM depreciate, item, new_item
WHERE depreciate.item_id=item.item_id
AND depreciate.item_id=new_item.id
AND new_item.data_mining=1
AND DATE_FORMAT('item.purchase_date', '%m %d') LIKE '%09-18%'
请问有人能告诉我这段代码的错误吗?我是新手。
最佳答案
尝试改变
AND DATE_FORMAT('item.purchase_date', '%m %d') LIKE '%09-18%'
到
HAVING DATE_FORMAT(`item`.`purchase_date`, '%m %d') LIKE '%09-18%'
关于php - 不正确的日期时间值 : 'item.purchase_date' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12472454/