不正确的日期时间值:“item.purchase date”
16lz
2021-01-22
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.
请谁能告诉我这段代码的错误?我是新手。
2 个解决方案
#1
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%'
更多相关文章
- 错误1452:无法添加或更新子行:外键约束失败
- Oracle相当于MySQL代码“插入虚拟”以返回错误消息
- MySQL添加外键错误1215
- 在SQL中声明@变量返回错误
- Linux第二篇----使用rpm方法安装MySQL(含各种出现的错误和排错)
- MySQL查询中的变量会导致错误
- mysql主从同步报slave_sql_running:no的解决方案
- mysql编译安装后各种常见错误集锦
- org.json Android系统错误。JSONException:在字符0处输入结束