когда я запускаю свой SQL в phpMyAdmin, мое поле даты и времени (pm_expense_ledger.hos_date) отображается в следующем формате: 2019-10-01 00: 00: 00
Хотя это не конечный пользователь GUI, как мне отформатировать поле даты и времени, чтобы оно отображалось как DDMMMYYYY ("% d% b% Y"), так как мне не нужно время при выполнении запроса?
Вы видите, что я Пробовал так же несколько раз безуспешно!
Код:
SELECT pm_expense_ledger_el_connector.property_id AS PropId,
/* show FIELDS from pm_expense_ledger; to view field column types */
pm_expense_ledger.hos_date AS Date, /* this is a datetime field */
/* DATE_FORMAT('pm_expense_ledger.hos_date', '%d%b%Y') AS FDate, returns null values */
/* DATE_FORMAT("pm_expense_ledger.hos_date", "%d %b %Y %H-%i-%S") AS D1,*/
/* DATE('pm_expense_ledger.hos_date', '%d %b %Y') AS D2,*/
/* DATE("pm_expense_ledger.hos_date", "%d %b %Y") AS D3, no difference using single or double quotes */
/* DATA_TYPE('pm_expense_ledger.hos_date'),*/
pm_homeowner_statement_key.key_name AS Item,
pm_expense_ledger_description.descr AS Description,
pm_expense_ledger_el_connector.hos_total AS HOS,
pm_expense_ledger.pm_expense_ledger_id AS pmelid,
pm_expense_ledger.expense_ledger_id AS elid
FROM pm_expense_ledger_el_connector
JOIN pm_expense_ledger
on pm_expense_ledger.pm_expense_ledger_id = pm_expense_ledger_el_connector.pm_exp_ledger_id
JOIN pm_expense_ledger_description
on pm_expense_ledger_description.pm_el_description_id = pm_expense_ledger.pm_exp_ledg_descr_id
JOIN pm_homeowner_statement_key
on pm_homeowner_statement_key.pm_hos_key_id = pm_expense_ledger.pm_hos_key_id
where pm_expense_ledger.hos_date BETWEEN '2019,12,01' and '2019,12,31'
/*group by pm_expense_ledger_el_connector.property_id*/
order by pm_expense_ledger_el_connector.property_id ASC, pm_expense_ledger.hos_date ASC, pm_expense_ledger_id ASC;