我有一张付款表。表字段的名称:
id
company_id
paid
create_et (datetime)
如果company_id = company_id且create_at 我的查询: 但是它不起作用。请帮帮我。
没有错误消息,但返回null。$sql = "SELECT SUM(paid) as paid FROM payments WHERE payments.company_id = $company_id AND CAST(payments.created_at AS date) < $specificdate";