0

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

0

1 Answer 1

3

You have inverted date_format parameters order.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks it didn't throw any errors when i rabn it +1, can't accept your answer for 6 mins :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.