0

Date から Month-Year を取得しようとしています。

私のコードは

SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, adempiere.c_invoice.dateinvoiced, 0))    
FROM adempiere.c_invoice

テキストとして編集すると発生するエラーは

An error occured while executing the query.
ERROR [42703] ERROR: column "month" does not exist;
Error while executing the query

Additional information: ->
Error [42703] Error: column "month" does not exist; Error while executing the query (PSQLODBC.DLL

データ サーバー ツールのクエリ デザイナーで「SQL を実行」する場合

「Month」になるMonthにプログラムが自動で(")を追加し、後ろに「AS Expr1」を追加します。こうなります。

SELECT        DATEADD("MONTH", DATEDIFF("MONTH", 0, adempiere.c_invoice.dateinvoiced, 0)) AS Expr1
FROM            adempiere.c_invoice

そして、エラーは

SQL Execution Error

Executed SQL statement: SELECT DATEADD("MONTH", DATEDIFF("MONTH", 0, adempiere.c_invoice.dateinvoiced, 0)) AS Expr1
FROM adempiere.c_invoice
Error Source: PSQLODBC.DLL
Error Message: ERROR [42703] ERRPR: Column "MONTH" does not exist;
Error while executing the query

読んでくれてありがとう。誰かが私を助けてくれることを願っています!

4

1 に答える 1