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%'
Please if someone can tell me the error of this code ? I'm new to this.
请谁能告诉我这段代码的错误?我是新手。
3
Try changing
试着改变
AND DATE_FORMAT('item.purchase_date', '%m %d') LIKE '%09-18%'
to
来
HAVING DATE_FORMAT(`item`.`purchase_date`, '%m %d') LIKE '%09-18%'
1
Do not use '
when you are passing column name to the DATE_FORMAT
function.
当您向DATE_FORMAT函数传递列名时,不要使用'。
Try with:
试一试:
... AND DATE_FORMAT(item.purchase_date, '%m %d') LIKE '%09-18%'
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2012/09/18/83d7886ab8d52059a5ee8c097a8f145.html。