I have this query which is returning a NULL value instead of the values I need. I need to add a ISNULL to the first line, but with all the trims, lefts, I am having trouble.
Where exactly would that go? It needs to be attached to dd.ODJCJOB
'Job: ' + LEFT(LTRIM(dd.ODJCJOB) + SPACE(16), 16) +
'Cost Code: ' + LEFT(LTRIM(dd.ODJCPHS) + SPACE(16), 16) +
'Amount: ' + LEFT(LTRIM(STR(dd.ODAMT, 14, 2)) + SPACE(16), 16)
from [ADCData].dbo.MASTER_APM_RECORD_2 dd
where dd.ODINV = '061711' and dd.ODVND = 'ASSURANTEM'