@RPLEGRAND Where are you trying to produce this label?
If you are doing a baq it will be an outer join with a check for the partNum+‘CO’ existing.
select top 10
Coalesce(p.partnum,jh.partnum) As [Label Part]
,p.partnum,jh.partnum
from JobHead jh
left outer join Part p on p.partnum = concat(jh.partnum ,'CO')
where jh.partnum like '13935%'
We are pre-printing labels from Bartender for production line as parts come off the machines.
We Job / Workorder would be created for part # 12345.
The challenge is not all parts have the CO at the end 12345CO.
So was thinking about the if else or if contains to return the correct part to use for printing the barcode.
So in Bartender they can select the Job # and print x qty of labels.
Job # is tied to 12345 and need label for 12345CO if the CO is a valid part number in part master.
The sql I posted will do that, but where are you triggering the bartender file from? I have never made bartender labels, so I am not familiar with the process.
If it is a bpm then you could use a .Any() statement to check for the CO part number existing.