mysql date-format返回null

时间:2011-04-26 15:35:27

标签: mysql null date-format

我有以下SQL查询。它为'invoice_date'返回NULL。

SELECT * , fk_uid AS userId, fk_ivid AS invoice_uid, (

SELECT company
FROM tbl_users
WHERE pk_uid = userId
) AS invoice_customer, (

SELECT DATE_FORMAT( '%d/%m/%y', purchased ) AS invoice_date
FROM _invoices
WHERE invoice_uid = invoice_uid
LIMIT 1
) AS invoice_date
FROM tbl_statement_items
WHERE statement_generated = '1'
AND fk_statementId = '1'
LIMIT 0 , 30

任何帮助都会得到满足。

由于

1 个答案:

答案 0 :(得分:3)

您已经反转了date_format个参数。