mysql 日期格式返回 null

发布于 2024-11-03 13:48:10 字数 461 浏览 0 评论 0原文

我有以下 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

任何帮助将不胜感激。

谢谢

I have the following SQL query. It returns NULL for the 'invoice_date'.

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

Any help would be appriciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

囚你心 2024-11-10 13:48:10

您颠倒了 date_format 参数顺序。

You have inverted date_format parameters order.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文