Hi,
I have the used the following code of which isn't working as I would have expected and that is due to my new column derived from the CASE statement shows all values as a NULL.
Is there something missing from my case statement that would ultimately make this work please?
selectdistinct(dbo.pk.job_number) as job_number,
dbo.PK.Client_Code,
dbo.pk.client_name,
DBO.DDI.INVOICE_DATE,
CASE
WHEN
'2018-01' >= FORMAT(DBO.DDI.INVOICE_DATE, 'yyyy-MM')
AND '2018-01' < Format (DBO.DDI.INVOICE_DATE, 'yyyy-MM')
THEN dbo.DDI.due_amount
END As Jan18
from
dbo.pk
left join dbo.ddi
on dbo.pk.job_number = dbo.ddi.job