1

コード:

SELECT

CONVERT(VARCHAR(10),Due_Date,101) AS Due_Date,
COST_PER_ACRES,
CASE WHEN Due_Amount IS NOT NULL AND Lease_Amount IS NOT NULL THEN '$' + CONVERT(VARCHAR(20),CAST(Due_Amount - Lease_Amount AS MONEY),1)
WHEN Due_Amount IS NULL THEN '$0.00' ELSE '$' + CONVERT(VARCHAR(20),CAST(Due_Amount AS MONEY),1) END AS RENTAL_AMOUNT_DUE,
CONVERT(VARCHAR(10),CHECK_DATE,101) AS Check_Date

FROM tblpayments PH 
LEFT JOIN tblcheck CD
    ON PH.ID = CD.lease_obligation_ID

WHERE PH.PAYMENT_TYPE_ID = 1657 AND PH.LEASE_ID = 76

ORDER BY YEAR(Due_Date)

次の出力を取得する方法を知りたいです。

ここに画像の説明を入力

私の現在の出力:

ここに画像の説明を入力

4

1 に答える 1