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。